1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-26 15:24:48 +02:00

Makes sure all file/dir paths are normalized to prepare for comparing.

Particularly the system docRoot and currentDir values passed to the URI
rewriter and the allowDirs check.
This commit is contained in:
Steve Clay
2016-05-12 13:29:54 -04:00
parent 7aac6792bc
commit de39966e9c
6 changed files with 50 additions and 17 deletions

View File

@@ -56,6 +56,11 @@ class Minify {
*/
protected $controller = null;
/**
* @var Minify_Env
*/
protected $env;
/**
* @var Minify_SourceInterface[]
*/
@@ -218,6 +223,8 @@ class Minify {
*/
public function serve(Minify_ControllerInterface $controller, $options = array())
{
$this->env = $controller->getEnv();
$options = array_merge($this->getDefaultOptions(), $options);
$config = $controller->createConfiguration($options);
@@ -499,7 +506,7 @@ class Minify {
protected function setupUriRewrites()
{
foreach($this->sources as $key => $source) {
$file = $source->getFilePath();
$file = $this->env->normalizePath($source->getFilePath());
$minifyOptions = $source->getMinifierOptions();
if ($file