fix for PHP warning "is_file(): open_basedir restriction in effect"

Example:
PHP Warning: is_file(): open_basedir restriction in effect. File(/home/users/.../user/plugins/.gitkeep/.gitkeep.yaml) is not within the allowed path(s): (/home/users/.../:/usr/share/pear/) in .../web/system/src/Grav/Common/Config.php:237
This commit is contained in:
Jan Chren
2014-09-05 14:43:15 +02:00
parent 0b0ce2eb27
commit 8da3eb32f0

View File

@@ -232,9 +232,10 @@ class Config extends Data
/** @var \DirectoryIterator $plugin */
foreach ($iterator as $plugin) {
$name = $plugin->getBasename();
$file = $plugin->getPathname() . DS . $name . YAML_EXT;
$dir = $plugin->getPathname() ;
$file = $dir . DS . $name . YAML_EXT;
if (!is_file($file)) {
if (!(is_dir($dir) && is_file($file))) {
continue;
}