Use constant('CONSTANT_NAME') rather than direct CONSTANT_NAME to get value

to avoid false errors of static code analyzer on undefined constants
feature/quickmenu
franck 2024-04-18 20:26:49 +02:00
parent a55c0b5d76
commit a641663fe9
Signed by: franck-paul
GPG Key ID: BC0939B7E6CF71E7
6 changed files with 6 additions and 6 deletions

View File

@ -75,7 +75,7 @@ class AntispamFilterAkismet extends SpamFilter
{
parent::__construct();
if (defined('DC_AKISMET_SUPER') && DC_AKISMET_SUPER && !App::auth()->isSuperAdmin()) {
if (defined('DC_AKISMET_SUPER') && constant('DC_AKISMET_SUPER') && !App::auth()->isSuperAdmin()) {
$this->has_gui = false;
}
}

View File

@ -71,7 +71,7 @@ class Backend extends Process
},
]);
if ((defined('DC_ANTISPAM_CONF_SUPER') && !DC_ANTISPAM_CONF_SUPER) || App::auth()->isSuperAdmin()) {
if ((defined('DC_ANTISPAM_CONF_SUPER') && !constant('DC_ANTISPAM_CONF_SUPER')) || App::auth()->isSuperAdmin()) {
App::behavior()->addBehaviors([
'adminBlogPreferencesFormV2' => BackendBehaviors::adminBlogPreferencesForm(...),
'adminBeforeBlogSettingsUpdate' => BackendBehaviors::adminBeforeBlogSettingsUpdate(...),

View File

@ -65,7 +65,7 @@ class IpLookup extends SpamFilter
{
parent::__construct();
if (defined('DC_DNSBL_SUPER') && DC_DNSBL_SUPER && !App::auth()->isSuperAdmin()) {
if (defined('DC_DNSBL_SUPER') && constant('DC_DNSBL_SUPER') && !App::auth()->isSuperAdmin()) {
$this->has_gui = false;
}
}

View File

@ -30,7 +30,7 @@ class Frontend extends Process
return false;
}
if (defined('DC_FAIRTRACKBACKS_FORCE') && DC_FAIRTRACKBACKS_FORCE) {
if (defined('DC_FAIRTRACKBACKS_FORCE') && constant('DC_FAIRTRACKBACKS_FORCE')) {
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
$stack->append(AntispamFilterFairTrackbacks::class);
});

View File

@ -37,7 +37,7 @@ class Prepend extends Process
return false;
}
if (defined('DC_FAIRTRACKBACKS_FORCE') && !DC_FAIRTRACKBACKS_FORCE) {
if (defined('DC_FAIRTRACKBACKS_FORCE') && !constant('DC_FAIRTRACKBACKS_FORCE')) {
App::behavior()->addBehavior('AntispamInitFilters', function (ArrayObject $stack) {
$stack->append(AntispamFilterFairTrackbacks::class);
});

View File

@ -336,7 +336,7 @@ class HttpClient extends Socket
$this->setHost($host, $port);
if (defined('HTTP_PROXY_HOST') && defined('HTTP_PROXY_PORT')) {
$this->setProxy(HTTP_PROXY_HOST, HTTP_PROXY_PORT);
$this->setProxy(constant('HTTP_PROXY_HOST'), constant('HTTP_PROXY_PORT'));
}
if ($timeout) {