From 55ea8a6912e1ff7e1587e9d684cdfbad63174d14 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 2 Dec 2020 12:00:05 +0100 Subject: [PATCH] #896 Added support for unicode characters in custom slugs --- module/Core/functions/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/Core/functions/functions.php b/module/Core/functions/functions.php index 2f7f86e9..6c82cbc7 100644 --- a/module/Core/functions/functions.php +++ b/module/Core/functions/functions.php @@ -18,7 +18,7 @@ const MIN_SHORT_CODES_LENGTH = 4; const DEFAULT_REDIRECT_STATUS_CODE = StatusCodeInterface::STATUS_FOUND; const DEFAULT_REDIRECT_CACHE_LIFETIME = 30; const LOCAL_LOCK_FACTORY = 'Shlinkio\Shlink\LocalLockFactory'; -const CUSTOM_SLUGS_REGEXP = '/[^A-Za-z0-9._~]+/'; +const CUSTOM_SLUGS_REGEXP = '/[^\pL\pN._~]/u'; // Any unicode word or number, plus ".", "_" and "~" chars function generateRandomShortCode(int $length): string {