Including Boostrap less file generate absolute URLs
wambaloo opened this issue · 0 comments
wambaloo commented
Hi !
I just found that including less bootstrap file generate absolute URLs for fonts. It cause glyphicon crash and not displayed.
I write a workaround in my local files but I really don't know if it's a real bug or if it's a configuration to do.
In my AssetsFileManager.php, line 208, I added these lines:
/* HACK LPO TO REPLACE ABSOLUTE URLS BY RELATIVES URL */
$regexRelativeUrl = "/(url\(')(C:)?[a-zA-Z0-9\/]*(\/bootstrap\/less\/fonts)/i";
if (preg_match_all($regexRelativeUrl, $sAssetFileFilteredContent, $matches)) {
$replace = array_unique($matches[0]);
foreach ($replace as $search) {
$sAssetFileFilteredContent = str_replace($search, "url('../fonts", $sAssetFileFilteredContent);
}
}
/* END HACK */