meenie / munee

Munee: Standalone PHP 5.3 Asset Optimisation & Manipulation
https://munee.herokuapp.com/
MIT License
832 stars 92 forks source link

CSS Relative paths wrongly converted #98

Open rauwebieten opened 8 years ago

rauwebieten commented 8 years ago

For example, I use font-awesome like this: <link rel="stylesheet" href="/bower_components/font-awesome/css/font-awesome.css">

Original file excerpt: src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');

Result: src: url("/\\/bower_components/font-awesome/fonts/fontawesome-webfont.eot?v=4.6.3");

Kind regards

meenie commented 8 years ago

I would suggest changing your .htaccess file to not run files from bower_components through Munee.

rauwebieten commented 8 years ago

I found what is causing my troubles, I am developing locally on a windows machine, and the SUB_FOLDER constant is not set correctly.

In munee/config/bootstrap.php there is on line 7 $subFolder = dirname($_SERVER['SCRIPT_NAME']); which give me a backslash (windows directory separator) instead of a slash. This makes fixing abs to rel URL's go wrong.

I am able to fix this in my munee.php by defining SUB_FOLDER myself, but I guess this happens on other windows machines too.

Kind regards, and thanks for your wonderful library!