Commit 13bc95ae by Klimov Paul

Fixed `yii\console\controllers\AssetController` breaks CSS URLs on Windows

parent 327dde72
...@@ -4,6 +4,7 @@ Yii Framework 2 Change Log ...@@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.0 under development 2.0.0 under development
----------------------- -----------------------
- Bug #4881: Fixed `yii\console\controllers\AssetController` breaks CSS URLs on Windows (klimov-paul)
- Bug #5171: Fixed the bug that ActiveForm + Pjax submit event is only triggered once (qiangxue) - Bug #5171: Fixed the bug that ActiveForm + Pjax submit event is only triggered once (qiangxue)
- Bug #5252: Null values are not properly handled by `RangeValidator` (githubjeka, qiangxue) - Bug #5252: Null values are not properly handled by `RangeValidator` (githubjeka, qiangxue)
- Bug #5260: `yii\i18n\Formatter::decimalSeparator` and `yii\i18n\Formatter::thousandSeparator` where not configurable when intl is not installed (execut, cebe) - Bug #5260: `yii\i18n\Formatter::decimalSeparator` and `yii\i18n\Formatter::thousandSeparator` where not configurable when intl is not installed (execut, cebe)
......
...@@ -513,7 +513,7 @@ EOD; ...@@ -513,7 +513,7 @@ EOD;
$content = ''; $content = '';
foreach ($inputFiles as $file) { foreach ($inputFiles as $file) {
$content .= "/*** BEGIN FILE: $file ***/\n" $content .= "/*** BEGIN FILE: $file ***/\n"
. $this->adjustCssUrl(file_get_contents($file), dirname($file), dirname($outputFile)) . $this->adjustCssUrl(file_get_contents($file), dirname(realpath($file)), dirname(realpath($outputFile)))
. "/*** END FILE: $file ***/\n"; . "/*** END FILE: $file ***/\n";
} }
if (!file_put_contents($outputFile, $content)) { if (!file_put_contents($outputFile, $content)) {
...@@ -530,6 +530,9 @@ EOD; ...@@ -530,6 +530,9 @@ EOD;
*/ */
protected function adjustCssUrl($cssContent, $inputFilePath, $outputFilePath) protected function adjustCssUrl($cssContent, $inputFilePath, $outputFilePath)
{ {
$inputFilePath = str_replace('\\', '/', $inputFilePath);
$outputFilePath = str_replace('\\', '/', $outputFilePath);
$sharedPathParts = []; $sharedPathParts = [];
$inputFilePathParts = explode('/', $inputFilePath); $inputFilePathParts = explode('/', $inputFilePath);
$inputFilePathPartsCount = count($inputFilePathParts); $inputFilePathPartsCount = count($inputFilePathParts);
......
...@@ -368,6 +368,12 @@ EOL; ...@@ -368,6 +368,12 @@ EOL;
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT==) format('truetype'); src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT==) format('truetype');
}", }",
], ],
[
'.published-same-dir-class {background-image: url(published_same_dir.png);}',
'C:\test\base\path\assets\input',
'C:\test\base\path\assets\output',
'.published-same-dir-class {background-image: url(../input/published_same_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