cosmetic nullsafe fix
This commit is contained in:
parent
42fcd1d204
commit
52f3e80180
@ -21,7 +21,9 @@ class Backend extends dcNsProcess
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
|
||||
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||
&& !is_null(dcCore::app()->auth) // nullsafe PHP < 8.0
|
||||
&& dcCore::app()->auth->isSuperAdmin();
|
||||
|
||||
return static::$init;
|
||||
}
|
||||
|
@ -26,18 +26,33 @@ class BackendBehaviors
|
||||
# admin plugins page tab
|
||||
public static function pluginsTabs(): void
|
||||
{
|
||||
// nullsafe PHP < 8.0
|
||||
if (is_null(dcCore::app()->adminurl)) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::modulesToolsTabs(dcCore::app()->plugins, explode(',', DC_DISTRIB_PLUGINS), dcCore::app()->adminurl->get('admin.plugins'));
|
||||
}
|
||||
|
||||
# admin themes page tab
|
||||
public static function themesTabs(): void
|
||||
{
|
||||
// nullsafe PHP < 8.0
|
||||
if (is_null(dcCore::app()->adminurl)) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::modulesToolsTabs(dcCore::app()->themes, explode(',', DC_DISTRIB_THEMES), dcCore::app()->adminurl->get('admin.blog.theme'));
|
||||
}
|
||||
|
||||
# generic page tab
|
||||
private static function modulesToolsTabs(dcModules $modules, array $excludes, string $page_url): void
|
||||
{
|
||||
// nullsafe PHP < 8.0
|
||||
if (is_null(dcCore::app()->blog)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$repos = empty($_POST['csvcheck']) ? null :
|
||||
(new CsvStore($modules, (string) dcCore::app()->blog->settings->get('system')->get('store_plugin_url'), true))->get(true);
|
||||
|
||||
|
@ -27,6 +27,9 @@ class CsvStoreParser extends dcStoreParser
|
||||
|
||||
foreach ($this->xml->module as $i) {
|
||||
$attrs = $i->attributes();
|
||||
if (!isset($attrs['id'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user