PHP 8 compat fixes for the core when trackack plugin is installed
This commit is contained in:
parent
e0d87c88cf
commit
ef79ef260b
@ -1358,8 +1358,10 @@ function serendipity_updertEntry($entry) {
|
||||
$categories = $entry['categories'];
|
||||
unset($entry['categories']);
|
||||
|
||||
if (isset($entry['had_categories'])) {
|
||||
$had_categories = $entry['had_categories'];
|
||||
unset($entry['had_categories']);
|
||||
}
|
||||
|
||||
$newEntry = 0;
|
||||
$exflag = 0;
|
||||
|
@ -760,7 +760,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match_all('@<img[^>]+?alt=["\']?([^\'">]+?)[\'"][^>]+?>@i', $names[$i], $img_alt)) {
|
||||
if (isset($names[$i]) && preg_match_all('@<img[^>]+?alt=["\']?([^\'">]+?)[\'"][^>]+?>@i', $names[$i], $img_alt)) {
|
||||
if (is_array($img_alt) && is_array($img_alt[0])) {
|
||||
foreach($img_alt[0] as $alt_idx => $alt_img) {
|
||||
// Replace all <img>s within a link with their respective ALT tag, so that references
|
||||
@ -780,7 +780,9 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
|
||||
if (is_object($serendipity['logger'] ?? null)) $serendipity['logger']->debug($row);
|
||||
}
|
||||
|
||||
if (isset($names[$i])) {
|
||||
$names[$i] = strip_tags($names[$i]);
|
||||
}
|
||||
if (empty($names[$i])) {
|
||||
if (is_object($serendipity['logger'] ?? null)) $serendipity['logger']->debug("Found reference $locations[$i] w/o name. Adding location as name");
|
||||
$names[$i] = $locations[$i];
|
||||
|
@ -31,7 +31,6 @@ if (!defined('serendipity_LANG_LOADED') || serendipity_LANG_LOADED !== true) {
|
||||
}
|
||||
|
||||
// Try and include preferred language from the configurated setting
|
||||
|
||||
if (@include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) {
|
||||
// Only here can we truly say the language is loaded
|
||||
define('serendipity_LANG_LOADED', true);
|
||||
|
@ -1816,13 +1816,13 @@ class serendipity_event extends serendipity_plugin
|
||||
} else {
|
||||
$key = &$eventData[0][$fieldname];
|
||||
}
|
||||
} elseif (is_array($eventData) && is_array($eventData['properties'])) {
|
||||
} elseif (is_array($eventData) && is_array($eventData['properties'] ?? null)) {
|
||||
if (!empty($eventData['properties']['ep_cache_' . $fieldname])) {
|
||||
$key = &$eventData['properties']['ep_cache_' . $fieldname];
|
||||
} else {
|
||||
$key = &$eventData[$fieldname];
|
||||
}
|
||||
} elseif (is_array($eventData[0]) && isset($eventData[0][$fieldname])) {
|
||||
} elseif (isset($eventData[0]) && isset($eventData[0][$fieldname])) {
|
||||
$key = &$eventData[0][$fieldname];
|
||||
} elseif (isset($eventData[$fieldname])) {
|
||||
$key = &$eventData[$fieldname];
|
||||
|
@ -772,7 +772,7 @@ class serendipity_event_entryproperties extends serendipity_event
|
||||
break;
|
||||
|
||||
case 'backend_entry_presave':
|
||||
if (is_array($serendipity['POST']['properties'])) {
|
||||
if (is_array($serendipity['POST']['properties'] ?? null)) {
|
||||
$this->applyProperties($serendipity['POST']['properties']);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user