mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
fix: /partage/<slug> routing (regex delimiter + nginx location)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user