From 461003c73e0552fb9424f15846b3bd5db8b4fcff Mon Sep 17 00:00:00 2001 From: Aaron Bushnell Date: Fri, 11 Sep 2020 13:35:16 -0400 Subject: [PATCH] Verify `COMPOSER_VENDOR_DIR` in conditional This corrects an issue where `COMPOSER_VENDOR_DIR` could be an empty value and this condition erroneously runs. Before running this condition we need to confirm `COMPOSER_VENDOR_DIR` is set and contains a value. For further details on this issue see: - craftcms/cms#6773 - laminas/laminas-feed#22 --- src/Autoloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Autoloader.php b/src/Autoloader.php index dd7dae3..6048766 100644 --- a/src/Autoloader.php +++ b/src/Autoloader.php @@ -66,7 +66,7 @@ public static function load() */ private static function getClassLoader() { - if (file_exists(getenv('COMPOSER_VENDOR_DIR') . '/autoload.php')) { + if (getenv('COMPOSER_VENDOR_DIR') && file_exists(getenv('COMPOSER_VENDOR_DIR') . '/autoload.php')) { return include getenv('COMPOSER_VENDOR_DIR') . '/autoload.php'; }