diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index f3bf5309a2f..48fd498a42c 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -22,6 +22,7 @@ - Fixed a bug where the `--uid` option on `resave/*` console commands wasn’t working. ([#3941](https://github.com/craftcms/cms/issues/3941)) - Fixed a SQL error that could occur when running `resave/*` console commands. - Fixed a PHP error that occurred when calling the deprecated `getError()` method on a model that had no errors. ([#3934](https://github.com/craftcms/cms/issues/3934)) +- Fixed a bug where new folder names would not be sanitized when created via asset manager. ([#3689](https://github.com/craftcms/cms/issues/3689)) ## 3.1.15 - 2019-02-26 diff --git a/src/helpers/Assets.php b/src/helpers/Assets.php index 625b4c12a44..e2901d6ca98 100644 --- a/src/helpers/Assets.php +++ b/src/helpers/Assets.php @@ -163,6 +163,10 @@ public static function prepareAssetName(string $name, bool $isFilename = true, b $baseName = '-'; } + if (!$isFilename) { + $baseName = $baseNameSanitized; + } + return $baseName . $extension; }