diff --git a/CHANGELOG.md b/CHANGELOG.md index 24bd6df0..11690ba5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this It can be provided during the installation, or as the `DB_UNIX_SOCKET` env var for the docker image. +* [#896](https://github.com/shlinkio/shlink/issues/896) Added support for unicode characters in custom slugs. + ### Changed * [#912](https://github.com/shlinkio/shlink/issues/912) Changed error templates to be plain html files, removing the dependency on `league/plates` package. diff --git a/module/Core/functions/functions.php b/module/Core/functions/functions.php index 2f7f86e9..6ae232be 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 letter or number, plus ".", "_" and "~" chars function generateRandomShortCode(int $length): string {