From f4e8e363cbf6728c085cc8f2439fe41cd88e2814 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 23 Apr 2024 21:06:17 +0200 Subject: [PATCH] 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 --- lib/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller.php b/lib/Controller.php index 85767b12..10973aa5 100644 --- a/lib/Controller.php +++ b/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; }