minify
minify copied to clipboard
CSS url with relative paths being rewritten incorrectly
I notice when CSS is minified , url references with relative paths (with double quotes) are being rewritten incorrectly :
before :
url("fonts/212c8ce9-e668-4bbf-ab50-783ebeaa2d8a.woff2")
after :
url(../wp-content/themes/theme/fonts/212c8ce9-e668-4bbf-ab50-783ebeaa2d8a.woff2)
This breaks the loading of most of my fonts and things of that nature.
No fix for that?
Before:
url(../webfonts/fa-brands-400.woff2)
After:
url(../../../../public_html/modules/painel/fonts/font-awesome/webfonts/fa-brands-400.woff2)
AFAIK Minify doesn't update the paths inside the CSS. It could be some other feature or plugin. But could you please provide a test case? Should look like this:
$tests[] = array(
'<<ACTUAL UNMINIFIED CSS>>',
'<<EXPECTED MINIFIED CSS>>',
);
Please check tests/css/CSSTest.php for examples.
I had the same problem. I commented out the two lines 339-340 in src/CSS.php and the symptoms stopped occurring.
$converter = $this->getPathConverter($source, $path ? : $source);
$css = $this->move($converter, $css);