Support for data urls in css aggr.

pull/17/head
Frode Petterson 2016-01-26 15:57:10 +01:00
parent 36ca38705f
commit 633186c0d5
1 changed files with 1 additions and 1 deletions

View File

@ -178,7 +178,7 @@ class H5PDefaultStorage implements \H5PFileStorage {
$content .= preg_replace_callback(
'/url\([\'"]?([^"\')]+)[\'"]?\)/i',
function ($matches) use ($cssRelPath) {
if (preg_match("/^([a-z0-9]+:)?\//i", $matches[1]) === 1) {
if (preg_match("/^(data:|([a-z0-9]+:)?\/)/i", $matches[1]) === 1) {
return $matches[0]; // Not relative, skip
}
return 'url("../' . $cssRelPath . $matches[1] . '")';