diff --git a/lib/model/QubitSlug.php b/lib/model/QubitSlug.php index 70e35b27cf..588e82623f 100644 --- a/lib/model/QubitSlug.php +++ b/lib/model/QubitSlug.php @@ -103,7 +103,7 @@ public static function slugify($slug, $creationType = null) case QubitSlug::SLUG_PERMISSIVE: if ($isAscii) { // ASCII allowlist: letters/digits and safe ASCII - _ ~ : ; , = * @; others become "-" - $slug = preg_replace('/[^A-Za-z0-9\-_:;,=\*@~]+/', '-', $slug); + $slug = preg_replace('/[^A-Za-z0-9\-_:,=\*@~]+/', '-', $slug); break; } @@ -114,7 +114,7 @@ public static function slugify($slug, $creationType = null) $slug = preg_replace('/\p{Pd}+/u', '-', $slug); // map Pd to "-" // Allow Unicode letters/digits plus safe ASCII: - _ ~ : ; , = * @ - $slug = preg_replace('/[^\p{L}\p{N}\-_:;,=\*@~]+/u', '-', $slug); // property-based allowlist + $slug = preg_replace('/[^\p{L}\p{N}\-_:,=\*@~]+/u', '-', $slug); // property-based allowlist break; diff --git a/test/phpunit/QubitSlugTest.php b/test/phpunit/QubitSlugTest.php index f9541fa8ad..3c6424f76b 100644 --- a/test/phpunit/QubitSlugTest.php +++ b/test/phpunit/QubitSlugTest.php @@ -41,12 +41,13 @@ public function providerAll(): array ['test----slug', 'test-slug', 'test-slug'], ['Test Slug', 'test-slug', 'Test-Slug'], ['Test Slug 123', 'test-slug-123', 'Test-Slug-123'], + ['Test;Slug', 'test-slug', 'Test-Slug'], // Apostrophes are removed ["Test 'Slug'", 'test-slug', 'Test-Slug'], // Allowed safe punctuation in permissive; becomes dashes in restrictive - ['a_-~:;,=*@b', 'a-b', 'a_-~:;,=*@b'], + ['a_-~:,=*@b', 'a-b', 'a_-~:,=*@b'], // Accented Latin transliteration vs preservation ['Tést Slug', 'test-slug', 'Tést-Slug'],