Просмотр исходного кода

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 2 лет назад
Родитель
Сommit
f4e8e363cb
1 измененных файлов с 1 добавлено и 1 удалено
  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;
         }