spartacus 2.39.2: php8 compat
This commit is contained in:
parent
ec70938faf
commit
f996065a89
@ -1,3 +1,7 @@
|
||||
2.39.2
|
||||
-------
|
||||
* PHP8 compatibility
|
||||
|
||||
2.39
|
||||
-------
|
||||
* Add new gitlab mirror for plugins and themes
|
||||
|
@ -27,7 +27,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_SPARTACUS_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Garvin Hicking');
|
||||
$propbag->add('version', '2.39');
|
||||
$propbag->add('version', '2.39.2');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '1.6',
|
||||
));
|
||||
@ -320,16 +320,16 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
case 'complete':
|
||||
$children[] = array(
|
||||
'tag' => $vals[$i]['tag'],
|
||||
'attributes' => $vals[$i]['attributes'],
|
||||
'value' => $vals[$i]['value']
|
||||
'attributes' => $vals[$i]['attributes'] ?? null,
|
||||
'value' => $vals[$i]['value'] ?? null
|
||||
);
|
||||
break;
|
||||
|
||||
case 'open':
|
||||
$children[] = array(
|
||||
'tag' => $vals[$i]['tag'],
|
||||
'attributes' => $vals[$i]['attributes'],
|
||||
'value' => $vals[$i]['value'],
|
||||
'attributes' => $vals[$i]['attributes'] ?? null,
|
||||
'value' => $vals[$i]['value'] ?? null,
|
||||
'children' => $this->GetChildren($vals, $i)
|
||||
);
|
||||
break;
|
||||
@ -429,6 +429,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
function &fetchfile($url, $target, $cacheTimeout = 0, $decode_utf8 = false, $sub = 'plugins')
|
||||
{
|
||||
global $serendipity;
|
||||
$serendipity['logger'] ?? $serendipity['logger'] = false;
|
||||
static $error = false;
|
||||
|
||||
// Fix double URL strings.
|
||||
@ -484,7 +485,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($check_health) {
|
||||
if (isset($check_health) && $check_health) {
|
||||
/*--JAM: Useful for later, when we have a health monitor for SPARTACUS
|
||||
$propbag = new serendipity_property_bag;
|
||||
$this->introspect($propbag);
|
||||
@ -530,7 +531,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
}
|
||||
} else {
|
||||
// Fetch file
|
||||
if (!$data) {
|
||||
if (! isset($data) || !$data) {
|
||||
$data = $response->getBody();
|
||||
}
|
||||
if (is_object($serendipity['logger'])) $serendipity['logger']->debug(sprintf(PLUGIN_EVENT_SPARTACUS_FETCHED_BYTES_URL, strlen($data), $target));
|
||||
@ -700,7 +701,6 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
}
|
||||
|
||||
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
|
||||
@xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, LANG_CHARSET);
|
||||
$xml_package = $xml_string . "\n" . $xml_package;
|
||||
xml_parse_into_struct($p, $xml_package, $vals);
|
||||
xml_parser_free($p);
|
||||
@ -1172,13 +1172,17 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
$bag = new serendipity_property_bag;
|
||||
$infoplugin->introspect($bag);
|
||||
$currentVersion = $bag->get('version');
|
||||
$upgradeVersion = $foreignPlugins[$plugin]['upgrade_version'] ? $foreignPlugins[$plugin]['upgrade_version'] : $foreignPlugins[$plugin]['version'];
|
||||
if (array_key_exists($plugin, $foreignPlugins)) {
|
||||
$upgradeVersion = $foreignPlugins[$plugin]['upgrade_version'] ? $foreignPlugins[$plugin]['upgrade_version'] : $foreignPlugins[$plugin]['version'];
|
||||
} else {
|
||||
$upgradeVersion = null;
|
||||
}
|
||||
if (version_compare($currentVersion, $upgradeVersion, '<')) {
|
||||
$upgradeCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $upgradeCount;
|
||||
return $upgradeCount ?? 0;
|
||||
}
|
||||
|
||||
function event_hook($event, &$bag, &$eventData, $addData = null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user