Fix incorrect conversion of absolute URLs

This commit is contained in:
Kijin Sung 2016-05-05 13:29:24 +09:00
parent 768118fda3
commit 7363f71d4a

View file

@ -325,7 +325,7 @@ class Formatter
$path_converter = new \MatthiasMullie\PathConverter\Converter($filename, $target_filename);
$content = preg_replace_callback('/\burl\\(([^)]+)\\)/iU', function($matches) use ($path_converter) {
$url = trim($matches[1], '\'"');
if (!strlen($url) || $url[0] === '/')
if (!strlen($url) || $url[0] === '/' || preg_match('#^(?:https?|data):#', $url))
{
return $matches[0];
}