Skip to content

Commit

Permalink
Verify COMPOSER_VENDOR_DIR in conditional
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aaronbushnell authored Sep 11, 2020
1 parent 646581b commit 461003c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down

0 comments on commit 461003c

Please sign in to comment.