1
0

PHP8 compat fixes for themes menu

This commit is contained in:
onli
2021-05-02 13:48:09 +02:00
parent 0303eec81e
commit 3d1c264ccd
2 changed files with 21 additions and 5 deletions

View File

@ -264,6 +264,8 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) {
if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) {
$data['custom_config'] = YES;
$data['custom_config_engine'] = $theme;
} else {
$data['custom_config'] = NO;
}
// Templates can depend on a possible "Engine" (i.e. "Engine: 2k11").
@ -277,19 +279,25 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) {
if (@is_file($serendipity['templatePath'] . $engine . '/config.inc.php')) {
$data['custom_config'] = YES;
$data['custom_config_engine'] = $engine;
} else {
$data['custom_config'] = NO;
}
}
}
if ( $theme != 'default' && $theme != 'default-rtl'
&& @is_dir($serendipity['templatePath'] . $theme . '/admin')
&& strtolower($data['backend']) == 'yes' ) {
&& strtolower($data['backend'] ?? '') == 'yes' ) {
$data['custom_admin_interface'] = YES;
} else {
$data['custom_admin_interface'] = NO;
}
# php 8 compat section
if (! isset($data['customURI'])) { $data['customURI'] = null; }
if (! isset($data['author'])) { $data['author'] = null; }
return $data;
}