CSS pipeline rewrite URL fix for webserver root-based paths (#1383)

* Implement fix to not rewrite paths in CSS pipeline when CSS URLs use a path startng at webserver root (e.g. url('/path/to/asset')) - fixes #1382

* Amend CSS pipeline's resource location checking predicates to use Utils::startsWith, and consolidate into a single predicate

* Add back colon to data URL prefix test

Copy error in last commit would have broken any relative path beginning with the string 'data'
This commit is contained in:
Hugh Barnes
2017-03-27 13:50:22 +13:00
committed by Andy Miller
parent 41e7142dfc
commit 5c40337ff0

View File

@@ -1255,13 +1255,8 @@ class Assets
$old_url = $matches[2];
// ensure this is not a data url
if (strpos($old_url, 'data:') === 0) {
return $matches[0];
}
// ensure this is not a remote url
if ($this->isRemoteLink($old_url)) {
// Ensure link is not rooted to webserver, a data URL, or to a remote host
if (Utils::startsWith($old_url, '/') || Utils::startsWith($old_url, 'data:') || $this->isRemoteLink($old_url)) {
return $matches[0];
}