php 8 compat fixes for plugin installation
This commit is contained in:
parent
ed24403d36
commit
17786592e7
@ -101,7 +101,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$value = $_POST['serendipity']['plugin']['override'][$config_item];
|
||||
}
|
||||
|
||||
if (is_array($_POST['serendipity']['plugin']['activate'][$config_item])) {
|
||||
if (is_array($_POST['serendipity']['plugin']['activate'][$config_item] ?? null)) {
|
||||
$active_values = array();
|
||||
foreach($_POST['serendipity']['plugin']['activate'][$config_item] as $ordered_item_value) {
|
||||
$ordered_item_value;
|
||||
@ -164,7 +164,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
serendipity_plugin_api::hook_event('backend_plugins_fetchlist', $foreignPlugins);
|
||||
$pluginstack = array_merge((array)$foreignPlugins['pluginstack'], $pluginstack);
|
||||
$errorstack = array_merge((array)$foreignPlugins['errorstack'], $errorstack);
|
||||
if ($serendipity['GET']['only_group'] == 'UPGRADE') {
|
||||
if (($serendipity['GET']['only_group'] ?? null) == 'UPGRADE') {
|
||||
// for upgrades, the distinction in sidebar and event-plugins is not useful. We will fetch both and mix the lists
|
||||
if ($serendipity['GET']['type'] == 'event') {
|
||||
$serendipity['GET']['type'] = 'sidebar';
|
||||
@ -181,7 +181,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
# load data for installed plugins
|
||||
$plugins = serendipity_plugin_api::get_installed_plugins();
|
||||
$classes = serendipity_plugin_api::enum_plugin_classes(($serendipity['GET']['type'] === 'event'));
|
||||
if ($serendipity['GET']['only_group'] == 'UPGRADE') {
|
||||
if (($serendipity['GET']['only_group'] ?? null) == 'UPGRADE') {
|
||||
$classes = array_merge($classes, serendipity_plugin_api::enum_plugin_classes(!($serendipity['GET']['type'] === 'event')));
|
||||
$data['type'] = 'both';
|
||||
}
|
||||
@ -266,9 +266,9 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$plugdata['pluginsource'] = PLUGIN_SOURCE_LOCAL;
|
||||
}
|
||||
# create pluggroups
|
||||
if ($serendipity['GET']['only_group'] == 'ALL') {
|
||||
if (($serendipity['GET']['only_group'] ?? null) == 'ALL') {
|
||||
$pluggroups['ALL'][] = $plugdata;
|
||||
} elseif ($serendipity['GET']['only_group'] == 'UPGRADE' && $plugdata['upgradable']) {
|
||||
} elseif (($serendipity['GET']['only_group'] ?? null) == 'UPGRADE' && $plugdata['upgradable']) {
|
||||
$pluggroups['UPGRADE'][] = $plugdata;
|
||||
} elseif (is_array($plugdata['groups'])) {
|
||||
foreach($plugdata['groups'] AS $group) {
|
||||
@ -284,7 +284,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$data['count_pluginstack'] = count($pluginstack);
|
||||
$data['errorstack'] = $errorstack;
|
||||
|
||||
if ($serendipity['GET']['only_group'] == 'UPGRADE') {
|
||||
if (($serendipity['GET']['only_group'] ?? null) == 'UPGRADE') {
|
||||
serendipity_plugin_api::hook_event('backend_pluginlisting_header_upgrade', $pluggroups);
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$data['groupnames'] = $groupnames;
|
||||
$data['pluggroups'] = $pluggroups;
|
||||
$data['formToken'] = serendipity_setFormToken();
|
||||
$data['only_group'] = $serendipity['GET']['only_group'];
|
||||
$data['only_group'] = $serendipity['GET']['only_group'] ?? null;
|
||||
$data['available_upgrades'] = isset($pluggroups['UPGRADE']);
|
||||
$requirement_failures = array();
|
||||
|
||||
|
@ -40,7 +40,7 @@ function serendipity_groupname($group) {
|
||||
* @return boolean Return code for array comparison
|
||||
*/
|
||||
function serendipity_pluginListSort($x, $y) {
|
||||
return strnatcasecmp($x['name'] . ' - ' . $x['description'], $y['name'] . ' - ' . $y['description']);
|
||||
return strnatcasecmp($x['name'] . ' - ' . ($x['description'] ?? ''), $y['name'] . ' - ' . ($y['description'] ?? ''));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -740,7 +740,7 @@ class serendipity_plugin_api
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($pluginlist[$pluginFile]) && !preg_match('@plugin_internal\.inc\.php@', $pluginFile)) {
|
||||
if (is_array($pluginlist[$pluginFile] ?? null) && !preg_match('@plugin_internal\.inc\.php@', $pluginFile)) {
|
||||
$data = $pluginlist[$pluginFile];
|
||||
if ((int) filemtime($pluginFile) == (int) $data['last_modified']) {
|
||||
$data['stackable'] = serendipity_db_bool($data['stackable']);
|
||||
|
@ -362,7 +362,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
foreach($paths AS $pathid => $path) {
|
||||
$stack .= $path . '/';
|
||||
|
||||
if ($spaths[$pathid] == $path) {
|
||||
if (($spaths[$pathid] ?? null) == $path) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1394,7 +1394,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
$eventData['GET']['pluginPath'] = $eventData['GET']['install_plugin'];
|
||||
}
|
||||
|
||||
if ($eventData['GET']['spartacus_upgrade']) {
|
||||
if ($eventData['GET']['spartacus_upgrade'] ?? false) {
|
||||
$eventData['install'] = false;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
{if !empty($license)}
|
||||
<p><b>{$CONST.MEDIA_PROPERTY_COPYRIGHT}:</b> {$license}</p>
|
||||
{/if}
|
||||
{if ! empty($documentation) || $changelog || $documentation_local}
|
||||
{if ! empty($documentation) || isset($changelog) || $documentation_local}
|
||||
<ul class="plainList">
|
||||
{if !empty($documentation)}
|
||||
<li><a href="{$documentation|escape}">{$CONST.PLUGIN_DOCUMENTATION}</a></li>
|
||||
@ -137,7 +137,7 @@
|
||||
<div class="plugin_status">
|
||||
{if isset($requirement_failures.{$plug.class_name})}
|
||||
<span class="unmet_requirements msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> {$CONST.UNMET_REQUIREMENTS|sprintf:"{if $requirement_failures.{$plug.class_name}.s9y}s9y $plug.requirements..serendipity,{/if} {if $requirement_failures.{$plug.class_name}.php}PHP $plug.requirements.php,{/if} {if $requirement_failures.{$plug.class_name}.smarty}Smarty $plug.requirements.smarty{/if}"}</span>
|
||||
{elseif $plug['upgradable'] == true}
|
||||
{elseif isset($plug['upgradable']) and $plug['upgradable'] == true}
|
||||
<a class="button_link" href="?serendipity[adminModule]=plugins&serendipity[pluginPath]={$plug.pluginPath}&serendipity[install_plugin]={$plug.plugin_class}{if isset($plug['customURI'])}{$plug.customURI}{/if}&{$urltoken}" title="{$CONST.PLUGIN_EVENT_SPARTACUS_CHECK_HINT}">{$CONST.UPGRADE}</a>
|
||||
{elseif $plug.installable == true}
|
||||
<a class="button_link" href="?serendipity[adminModule]=plugins&serendipity[pluginPath]={$plug.pluginPath}&serendipity[install_plugin]={$plug.plugin_class}{if isset($plug.customURI)}{$plug.customURI}{/if}&{$urltoken}">{$CONST.INSTALL}</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user