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
This commit is contained in:
El RIDO 2024-04-23 21:06:17 +02:00
parent 8b3d66b8e2
commit f4e8e363cb
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92

View file

@ -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;
}