diff --git a/include/plugin_api.inc.php b/include/plugin_api.inc.php index 43dca2f4..e37f04b8 100644 --- a/include/plugin_api.inc.php +++ b/include/plugin_api.inc.php @@ -526,7 +526,7 @@ class serendipity_plugin_api global $serendipity; // Can be shortcircuited via a $serendipity['prevent_sidebar_plugins_(left|right|event)'] variable! - if (!$negate && $serendipity['prevent_sidebar_plugins_' . $filter] == true) { + if (!$negate && ($serendipity['prevent_sidebar_plugins_' . $filter] ?? false) == true) { return 0; } @@ -1144,7 +1144,7 @@ class serendipity_plugin_api // skip the execution of any follow-up plugins. $plugins = serendipity_plugin_api::get_event_plugins(); - if ($serendipity['core_events'][$event_name]) { + if (array_key_exists($event_name, $serendipity['core_events']) && $serendipity['core_events'][$event_name]) { foreach($serendipity['core_events'][$event_name] as $apifunc_key => $apifunc) { $apifunc($event_name, $bag, $eventData, $addData); } @@ -1308,9 +1308,9 @@ class serendipity_plugin_api $probelang = $path . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php'; if (file_exists($probelang)) { include $probelang; + } else { + include $path . '/lang_en.inc.php'; } - - include $path . '/lang_en.inc.php'; } } @@ -1539,13 +1539,13 @@ class serendipity_plugin break; case 'url': - if (!preg_match('§^' . $pattern_url . '$§', $value)) { + if (!preg_match('§^' . $pattern_url . '$§', $value)) { $valid = false; } break; case 'mail': - if (!preg_match('§^' . $pattern_mail . '$§', $value)) { + if (!preg_match('§^' . $pattern_mail . '$§', $value)) { $valid = false; } break; @@ -1797,7 +1797,7 @@ class serendipity_event extends serendipity_plugin * @param array The entry superarray to get the reference from * @return array The value of the array for the fieldname (reference) */ - function &getFieldReference($fieldname = 'body', &$eventData) + function &getFieldReference($fieldname = 'body', &$eventData = []) { // Get a reference to a content field (body/extended) of // $entries input data. This is a unifying function because