php 8 compat: Fix unused key and empty path, for css

This commit is contained in:
onli 2021-03-15 23:41:03 +01:00
parent a3253a0d55
commit df6d80f328
2 changed files with 4 additions and 1 deletions

View File

@ -273,7 +273,7 @@ function serendipity_getTemplateFile($file, $key = 'serendipityHTTPPath', $force
foreach ($directories as $directory) {
$templateFile = $serendipity['templatePath'] . $directory . $file;
if (file_exists($serendipity['serendipityPath'] . $templateFile)) {
return $serendipity[$key] . $templateFile;
return ($serendipity[$key] ?? '') . $templateFile;
}
if (file_exists($serendipity['serendipityPath'] . $templateFile . ".tpl")) {

View File

@ -38,6 +38,9 @@ switch($css_mode) {
function serendipity_printStylesheet($file, $dir = '') {
global $serendipity;
if (empty($file)) {
return '';
}
return "\n/* auto include $dir */\n\n" . str_replace(
array(
'{TEMPLATE_PATH}',