fix nullsafe warnings
parent
867845f8fa
commit
ba13d88082
|
@ -41,7 +41,7 @@ class Backend extends dcNsProcess
|
||||||
'adminDashboardFavoritesV2' => function (dcFavorites $favs): void {
|
'adminDashboardFavoritesV2' => function (dcFavorites $favs): void {
|
||||||
$favs->register(My::id(), [
|
$favs->register(My::id(), [
|
||||||
'title' => My::name(),
|
'title' => My::name(),
|
||||||
'url' => dcCore::app()->adminurl->get('admin.plugin.' . My::id()),
|
'url' => dcCore::app()->adminurl?->get('admin.plugin.' . My::id()),
|
||||||
'small-icon' => dcPage::getPF(My::id() . '/icon.svg'),
|
'small-icon' => dcPage::getPF(My::id() . '/icon.svg'),
|
||||||
'large-icon' => dcPage::getPF(My::id() . '/icon.svg'),
|
'large-icon' => dcPage::getPF(My::id() . '/icon.svg'),
|
||||||
//'permissions' => dcCore::app()->auth->isSuperAdmin(),
|
//'permissions' => dcCore::app()->auth->isSuperAdmin(),
|
||||||
|
@ -56,9 +56,9 @@ class Backend extends dcNsProcess
|
||||||
|
|
||||||
dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
|
dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
|
||||||
My::name(),
|
My::name(),
|
||||||
dcCore::app()->adminurl->get('admin.plugin.' . My::id()),
|
dcCore::app()->adminurl?->get('admin.plugin.' . My::id()),
|
||||||
dcPage::getPF(My::id() . '/icon.svg'),
|
dcPage::getPF(My::id() . '/icon.svg'),
|
||||||
preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . My::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
|
preg_match('/' . preg_quote((string) dcCore::app()->adminurl?->get('admin.plugin.' . My::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
|
||||||
dcCore::app()->auth?->isSuperAdmin()
|
dcCore::app()->auth?->isSuperAdmin()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ use Dotclear\Helper\Html\Form\{
|
||||||
Text
|
Text
|
||||||
};
|
};
|
||||||
use Dotclear\Helper\File\Path;
|
use Dotclear\Helper\File\Path;
|
||||||
|
use Dotclear\Helper\Network\Http;
|
||||||
use Exception;
|
use Exception;
|
||||||
use http;
|
|
||||||
|
|
||||||
class Manage extends dcNsProcess
|
class Manage extends dcNsProcess
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ class Manage extends dcNsProcess
|
||||||
dcPage::addSuccessNotice(
|
dcPage::addSuccessNotice(
|
||||||
__('License successfully added.')
|
__('License successfully added.')
|
||||||
);
|
);
|
||||||
http::redirect(
|
Http::redirect(
|
||||||
empty($_POST['redir']) ?
|
empty($_POST['redir']) ?
|
||||||
dcCore::app()->admin->getPageURL() : $_POST['redir']
|
dcCore::app()->admin->getPageURL() : $_POST['redir']
|
||||||
);
|
);
|
||||||
|
@ -212,7 +212,7 @@ class Manage extends dcNsProcess
|
||||||
{
|
{
|
||||||
if (!(dcCore::app()->themes instanceof dcThemes)) {
|
if (!(dcCore::app()->themes instanceof dcThemes)) {
|
||||||
dcCore::app()->themes = new dcThemes();
|
dcCore::app()->themes = new dcThemes();
|
||||||
dcCore::app()->themes->loadModules(dcCore::app()->blog->themes_path, null);
|
dcCore::app()->themes->loadModules((string) dcCore::app()->blog?->themes_path, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -34,6 +34,10 @@ class Utils
|
||||||
*/
|
*/
|
||||||
public static function addLicense(array $module): void
|
public static function addLicense(array $module): void
|
||||||
{
|
{
|
||||||
|
if (is_null(dcCore::app()->auth)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$s = Settings::init();
|
$s = Settings::init();
|
||||||
|
|
||||||
# --BEHAVIOR-- licenseBootstrapBeforeAddLicense
|
# --BEHAVIOR-- licenseBootstrapBeforeAddLicense
|
||||||
|
@ -237,7 +241,7 @@ class Utils
|
||||||
*/
|
*/
|
||||||
protected static function replacePhpContent(string $content, string $license, bool $overwrite): string
|
protected static function replacePhpContent(string $content, string $license, bool $overwrite): string
|
||||||
{
|
{
|
||||||
$clean = preg_replace(
|
$clean = (string) preg_replace(
|
||||||
'/((# -- BEGIN LICENSE BLOCK ([-]+))(.*?)' .
|
'/((# -- BEGIN LICENSE BLOCK ([-]+))(.*?)' .
|
||||||
'(# -- END LICENSE BLOCK ([-]+))([\n|\r\n]+))/msi',
|
'(# -- END LICENSE BLOCK ([-]+))([\n|\r\n]+))/msi',
|
||||||
'',
|
'',
|
||||||
|
@ -248,7 +252,7 @@ class Utils
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
return preg_replace(
|
return (string) preg_replace(
|
||||||
'/(\<\?php)/',
|
'/(\<\?php)/',
|
||||||
'<?php' .
|
'<?php' .
|
||||||
"\r\n# -- BEGIN LICENSE BLOCK ----------------------------------\r\n" .
|
"\r\n# -- BEGIN LICENSE BLOCK ----------------------------------\r\n" .
|
||||||
|
|
Loading…
Reference in New Issue