Closed GoogleCodeExporter closed 9 years ago
A simple solution would be for the user to prepend something like
"http://cdn.example.org/a/a/" and then Minify to automatically remove parent
traversals where possible.
../../images/123.jpg => (prepend)
http://cdn.example.org/a/a/../../images/123.jpg => (remove traversal)
http://cdn.example.org/a/../images/123.jpg => (remove traversal)
http://cdn.example.org/images/123.jpg
Thoughts?
Original comment by mrclay....@gmail.com
on 14 Dec 2010 at 4:27
That would work, but it doesn't address the use case I had in mind.
For development, user creates CSS and assets with relative paths.
For deployment, minify is used to combine, compress and rewrite the CSS to
appropriate paths. This case is exactly how it is used and works today.
The enhancement would be that I don't want to point at my production server
(CSS-relative path), I want to point to an absolute path for assets.
Original comment by darp...@gmail.com
on 15 Dec 2010 at 7:11
In config.php you would have code like:
if (/* is production environment */) {
$min_serveOptions['rewriteCssUris'] = false;
$min_serveOptions['minifierOptions']['text/css']['prependRelativePath'] = 'http://cdn.example.org/a/a/';
}
The result is that, on development Minify rewrites as normal, but on production
the rewrited URLs point to the CDN (with "/a/a/../../" replaced with "/").
Original comment by mrclay....@gmail.com
on 16 Dec 2010 at 7:09
R436 adds "../" removal to prependRlativePath operations. Just replace
UriRewriter.php from the new version. With my suggestion in comment 3
(branching config code per environment) you should be able to get the desired
behavior.
Original comment by mrclay....@gmail.com
on 19 Dec 2010 at 9:07
Original issue reported on code.google.com by
darp...@gmail.com
on 14 Dec 2010 at 3:01