mirror of
https://github.com/mrclay/minify.git
synced 2025-08-26 23:34:44 +02:00
MinApp.php : Log problems involving 'allowDirs' option
This commit is contained in:
@@ -104,16 +104,23 @@ class Minify_Controller_MinApp extends Minify_Controller_Base {
|
|||||||
}
|
}
|
||||||
$allowDirs = array();
|
$allowDirs = array();
|
||||||
foreach ((array)$cOptions['allowDirs'] as $allowDir) {
|
foreach ((array)$cOptions['allowDirs'] as $allowDir) {
|
||||||
$allowDirs[] = realpath(str_replace('//', $_SERVER['DOCUMENT_ROOT'] . '/', $allowDir));
|
$allowDir = str_replace('//', $_SERVER['DOCUMENT_ROOT'] . '/', $allowDir);
|
||||||
|
$realAllowDir = realpath($allowDir);
|
||||||
|
if (false === $realAllowDir) {
|
||||||
|
$this->log("AllowDir path '{$allowDir}' failed realpath()");
|
||||||
|
} else {
|
||||||
|
$allowDirs[] = $realAllowDir;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$path = $_SERVER['DOCUMENT_ROOT'] . $base . $file;
|
$path = $_SERVER['DOCUMENT_ROOT'] . $base . $file;
|
||||||
$file = realpath($path);
|
$file = realpath($path);
|
||||||
if (false === $file) {
|
if (false === $file) {
|
||||||
$this->log("Path \"{$path}\" failed realpath()");
|
$this->log("Path '{$path}' failed realpath()");
|
||||||
return $options;
|
return $options;
|
||||||
} elseif (! parent::_fileIsSafe($file, $allowDirs)) {
|
} elseif (! parent::_fileIsSafe($file, $allowDirs)) {
|
||||||
$this->log("Path \"{$path}\" failed Minify_Controller_Base::_fileIsSafe()");
|
$this->log("File '{$file}' was not found, or not located"
|
||||||
|
. " inside the 'allowDirs': " . var_export($allowDirs, 1));
|
||||||
return $options;
|
return $options;
|
||||||
} else {
|
} else {
|
||||||
$sources[] = new Minify_Source(array(
|
$sources[] = new Minify_Source(array(
|
||||||
|
Reference in New Issue
Block a user