Commit b6ec6085 by Klimov Paul

Method "AssetController::adjustCssUrl()" has been complete.

parent 265a6f1c
......@@ -579,7 +579,7 @@ EOD
return str_replace($inputUrl, $outputUrl, $fullMatch);
};
$cssContent = preg_replace_callback('/[\w\-]:\s*url\("([^"]*)"\)+/is', $callback, $cssContent);
$cssContent = preg_replace_callback('/url\(["\']?([^"]*)["\']?\)/is', $callback, $cssContent);
return $cssContent;
}
......
......@@ -263,22 +263,22 @@ class AssetControllerTest extends TestCase
{
return array(
array(
'.published-same-dir-class {background-image: url("published_same_dir.png");}',
'.published-same-dir-class {background-image: url(published_same_dir.png);}',
'/test/base/path/assets/input',
'/test/base/path/assets/output',
'.published-same-dir-class {background-image: url("../input/published_same_dir.png");}',
'.published-same-dir-class {background-image: url(../input/published_same_dir.png);}',
),
array(
'.published-relative-dir-class {background-image: url("../img/published_relative_dir.png");}',
'.published-relative-dir-class {background-image: url(../img/published_relative_dir.png);}',
'/test/base/path/assets/input',
'/test/base/path/assets/output',
'.published-relative-dir-class {background-image: url("../img/published_relative_dir.png");}',
'.published-relative-dir-class {background-image: url(../img/published_relative_dir.png);}',
),
array(
'.static-same-dir-class {background-image: url("static_same_dir.png");}',
'.static-same-dir-class {background-image: url(\'static_same_dir.png\');}',
'/test/base/path/css',
'/test/base/path/assets/output',
'.static-same-dir-class {background-image: url("../../css/static_same_dir.png");}',
'.static-same-dir-class {background-image: url(\'../../css/static_same_dir.png\');}',
),
array(
'.static-relative-dir-class {background-image: url("../img/static_relative_dir.png");}',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment