Fixed yii\console\controllers\AssetController::adjustCssUrl() breaks URL reference specification (url(#id))

This commit is contained in:
Klimov Paul
2016-11-29 10:24:39 +02:00
parent 16a5777e0f
commit 18b0dab360
3 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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)}",
],
];
}