#896 Added support for unicode characters in custom slugs

This commit is contained in:
Alejandro Celaya 2020-12-02 12:00:05 +01:00
parent 179ddc5bd7
commit 55ea8a6912

View File

@ -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
{