Skip to content

Commit

Permalink
Fixed slug generation for some unicode chars
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jul 25, 2019
1 parent 3d5e2d7 commit ab3095b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Expand Up @@ -8,6 +8,7 @@
- Fixed a bug where installing a plugin immediately after installing Craft from the console could corrupt the project config if `useProjectConfigFile` was enabled. ([#3870](https://github.com/craftcms/cms/issues/3870))
- Fixed a bug where entry forms could overlook changes made to Categories fields. ([#4648](https://github.com/craftcms/cms/issues/4648))
- Fixed a bug where element search indexes weren’t being updated right away after an element was created or updated from an element editor HUD.
- Fixed a bug where back-end slug validation wasn’t working correctly for slugs with some unicode characters. ([#1535](https://github.com/craftcms/cms/issues/1535))

## 3.2.6 - 2019-07-23

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/ElementHelper.php
Expand Up @@ -66,7 +66,7 @@ public static function createSlug(string $str): string
$str = StringHelper::stripHtml($str);

// Remove inner-word punctuation
$str = preg_replace('/[\'"‘’“”\[\]\(\)\{\}:]/', '', $str);
$str = preg_replace('/[\'"‘’“”\[\]\(\)\{\}:]/u', '', $str);

// Make it lowercase
$generalConfig = Craft::$app->getConfig()->getGeneral();
Expand Down
1 change: 1 addition & 0 deletions tests/unit/helpers/ElementHelperTest.php
Expand Up @@ -178,6 +178,7 @@ public function createSlugDataProvider(): array
['test_slug', 'test_slug'],
['Audi[separator-here]S8[separator-here]4E[separator-here]2006-2010', 'Audi S8 4E (2006-2010)'], // https://github.com/craftcms/cms/issues/4607
['こんにちは', 'こんにちは'], // https://github.com/craftcms/cms/issues/4628
['Сертификация', 'Сертификация'], // https://github.com/craftcms/cms/issues/1535
];
}

Expand Down

0 comments on commit ab3095b

Please sign in to comment.