fix: /partage/<slug> routing (regex delimiter + nginx location)

This commit is contained in:
Pontoporeia
2026-04-16 12:00:28 +02:00
parent b7be93e30b
commit a6df3c8c0e
11 changed files with 254 additions and 288 deletions

View File

@@ -30,7 +30,11 @@ class ShareLink
public static function generateSlug(): string
{
$date = date('Ymd');
$random = substr(strtoupper(rtrim(base64_encode(random_bytes(7)), '=')), 0, 8);
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
$random = '';
for ($i = 0; $i < 8; $i++) {
$random .= $chars[random_int(0, strlen($chars) - 1)];
}
return $date . '-' . $random;
}