PHP8 compat for frontpage, plugin-api warning
This commit is contained in:
@ -526,7 +526,7 @@ class serendipity_plugin_api
|
|||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
// Can be shortcircuited via a $serendipity['prevent_sidebar_plugins_(left|right|event)'] variable!
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1144,7 +1144,7 @@ class serendipity_plugin_api
|
|||||||
// skip the execution of any follow-up plugins.
|
// skip the execution of any follow-up plugins.
|
||||||
$plugins = serendipity_plugin_api::get_event_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) {
|
foreach($serendipity['core_events'][$event_name] as $apifunc_key => $apifunc) {
|
||||||
$apifunc($event_name, $bag, $eventData, $addData);
|
$apifunc($event_name, $bag, $eventData, $addData);
|
||||||
}
|
}
|
||||||
@ -1308,9 +1308,9 @@ class serendipity_plugin_api
|
|||||||
$probelang = $path . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
$probelang = $path . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||||
if (file_exists($probelang)) {
|
if (file_exists($probelang)) {
|
||||||
include $probelang;
|
include $probelang;
|
||||||
|
} else {
|
||||||
|
include $path . '/lang_en.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
include $path . '/lang_en.inc.php';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1539,13 +1539,13 @@ class serendipity_plugin
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'url':
|
case 'url':
|
||||||
if (!preg_match('<EFBFBD>^' . $pattern_url . '$<EFBFBD>', $value)) {
|
if (!preg_match('§^' . $pattern_url . '$§', $value)) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mail':
|
case 'mail':
|
||||||
if (!preg_match('<EFBFBD>^' . $pattern_mail . '$<EFBFBD>', $value)) {
|
if (!preg_match('§^' . $pattern_mail . '$§', $value)) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1797,7 +1797,7 @@ class serendipity_event extends serendipity_plugin
|
|||||||
* @param array The entry superarray to get the reference from
|
* @param array The entry superarray to get the reference from
|
||||||
* @return array The value of the array for the fieldname (reference)
|
* @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
|
// Get a reference to a content field (body/extended) of
|
||||||
// $entries input data. This is a unifying function because
|
// $entries input data. This is a unifying function because
|
||||||
|
Reference in New Issue
Block a user