Procházet zdrojové kódy

fix scrutinizer reported issue

empty only works with variables, not constants - here we want to error out if PATH either isn't defined or does not end in a directory separator, so we can concatenate onto it
El RIDO před 2 roky
rodič
revize
f4e8e363cb
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/Controller.php

+ 1 - 1
lib/Controller.php

@@ -114,7 +114,7 @@ class Controller
             error_log(I18n::_('%s requires php %s or above to work. Sorry.', I18n::_('PrivateBin'), self::MIN_PHP_VERSION));
             return;
         }
-        if (!empty(PATH) && substr(PATH, -1) !== DIRECTORY_SEPARATOR) {
+        if (!defined('PATH') || substr(PATH, -1) !== DIRECTORY_SEPARATOR) {
             error_log(I18n::_('%s requires the PATH to end in a "%s". Please update the PATH in your index.php.', I18n::_('PrivateBin'), DIRECTORY_SEPARATOR));
             return;
         }