meenie / munee

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

Font type created #92

Open Crecket opened 8 years ago

Crecket commented 8 years ago

This should fix the font-encoding issue for libraries like Font-Awesome. All it does is return the font-file and it stops Munee from returning the "Error: The following extension is not handled: woff2" error.

91

meenie commented 8 years ago

I feel like this is only an issue if you are using Munee without using a RewriteRule. So we shouldn't even be passing a font file through Munee. So the best way to go about this is to fix this part of the code:. If there were a good reason to run Fonts through Munee, this would be the 100% best fix.

What do you think?

Crecket commented 8 years ago

I agree that it isn't the best way to go about this though, I'm not sure how we can fix it though. The code you referenced isn't reached because the Registry returns a File is not handled error

meenie commented 8 years ago

The reason it's running the font through Munee is because:

  1. You are not using a RewriteRule, meaning you are using munee like: munee.php?files=my-css.css
  2. Munee knows that you aren't using a RewriteRule, so when it compiles the CSS, it rewrites all URLs to prefix them with munee.php?files=<path-to-file>.

If you were using a RewriteRule, this wouldn't be an issue, because Munee would not try to rewrite the URLs to run them through munee.php?files=<path-to-file>.

So to stop this, in the code I linked to above, it needs to not rewrite the URL if it's a font. I hope that makes sense :)