Skip to content

Commit

Permalink
Fixed yii\console\controllers\AssetController breaks CSS URLs, whic…
Browse files Browse the repository at this point in the history
…h start from '/'
  • Loading branch information
klimov-paul committed Nov 11, 2014
1 parent 1605905 commit 112ad80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Yii Framework 2 Change Log
- Bug #4889: Application was getting into redirect loop when user wasn't allowed accessing login page. Now shows 403 (samdark)
- Bug #5402: Debugger was not loading when there were closures in asset classes (samdark)
- Bug #5452: Errors occurring after the response is sent are not displayed (qiangxue)
- Bug #5521: Fixed `yii\console\controllers\AssetController` breaks CSS URLs, which start from '/' (klimov-paul)
- Bug #5570: `yii\bootstrap\Tabs` would throw an exception if `content` is not set for one of its `items` (RomeroMsk)
- Bug #5584: `yii\rbac\DbRbacManager` should not delete items when deleting a rule on a database not supporting cascade update (mdmunir)
- Bug #5601: Simple conditions in Query::where() and ActiveQuery::where() did not allow `yii\db\Expression` to be used as the value (cebe, stevekr)
Expand Down
2 changes: 1 addition & 1 deletion framework/console/controllers/AssetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ protected function adjustCssUrl($cssContent, $inputFilePath, $outputFilePath)
$fullMatch = $matches[0];
$inputUrl = $matches[1];

if (preg_match('/^https?:\/\//is', $inputUrl) || preg_match('/^data:/is', $inputUrl)) {
if (strpos($inputUrl, '/') === 0 || preg_match('/^https?:\/\//is', $inputUrl) || preg_match('/^data:/is', $inputUrl)) {
return $fullMatch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ public function adjustCssUrlDataProvider()
'C:\test\base\path\assets\output',
'.published-same-dir-class {background-image: url(../input/published_same_dir.png);}',
],
[
'.static-root-relative-class {background-image: url(\'/images/static_root_relative.png\');}',
'/test/base/path/css',
'/test/base/path/assets/output',
'.static-root-relative-class {background-image: url(\'/images/static_root_relative.png\');}',
],
];
}

Expand Down

0 comments on commit 112ad80

Please sign in to comment.