diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 7e4f34c0c0..8893ef834c 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -24,6 +24,7 @@ Yii Framework 2 Change Log - Bug #12939: Hard coded table names for MSSQL in RBAC migration (arogachev) - Bug #12974: Fixed incorrect order of migrations history in case `yii\console\controllers\MigrateController::$migrationNamespaces` is in use (evgen-d, klimov-paul) - Bug #13071: Help option for commands was not working in modules (arogachev, haimanman) +- Bug #13089: Fixed `yii\console\controllers\AssetController::adjustCssUrl()` breaks URL reference specification (`url(#id)`) (vitalyzhakov) - Bug #7727: Fixed truncateHtml leaving extra tags (developeruz) - Enh #6809: Added `\yii\caching\Cache::$defaultDuration` property, allowing to set custom default cache duration (sdkiller) - Enh #7333: Improved error message for `yii\di\Instance::ensure()` when a component does not exist (cebe) diff --git a/framework/console/controllers/AssetController.php b/framework/console/controllers/AssetController.php index d0f8fbfe9c..5ed5bb0ccb 100644 --- a/framework/console/controllers/AssetController.php +++ b/framework/console/controllers/AssetController.php @@ -638,7 +638,7 @@ EOD; $fullMatch = $matches[0]; $inputUrl = $matches[1]; - if (strpos($inputUrl, '/') === 0 || preg_match('/^https?:\/\//i', $inputUrl) || preg_match('/^data:/i', $inputUrl)) { + if (strpos($inputUrl, '/') === 0 || strpos($inputUrl, '#') === 0 || preg_match('/^https?:\/\//i', $inputUrl) || preg_match('/^data:/i', $inputUrl)) { return $fullMatch; } if ($inputFileRelativePathParts === $outputFileRelativePathParts) { diff --git a/tests/framework/console/controllers/AssetControllerTest.php b/tests/framework/console/controllers/AssetControllerTest.php index 0517f717e9..e252410b81 100644 --- a/tests/framework/console/controllers/AssetControllerTest.php +++ b/tests/framework/console/controllers/AssetControllerTest.php @@ -537,6 +537,12 @@ EOL; '/test/base/path/assets/css', '.published-relative-dir-class {background-image: url(../img/same_relative_dir.png);}', ], + [ + "img {clip-path: url(#xxx)}", + '/test/base/path/css', + '/test/base/path/assets/output', + "img {clip-path: url(#xxx)}", + ], ]; }