mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
Compare commits
2 Commits
772e375ac5
...
7dc7e45e5f
Author | SHA1 | Date | |
---|---|---|---|
|
7dc7e45e5f | ||
|
a550fd1436 |
@ -108,7 +108,7 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSubscribeUrl(string $token, $subscribeUrl = null)
|
||||
public static function getSubscribeUrl(string $token, $subscribeUrl = null)
|
||||
{
|
||||
$strs = 'QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm';
|
||||
$randstr = substr(str_shuffle($strs), 0, rand(4,8));
|
||||
@ -120,9 +120,10 @@ class Helper
|
||||
$subscribeUrl = self::replaceByPattern($subscribeUrl);
|
||||
if (strpos($subscribeUrl, "*") !== false) {
|
||||
$subscribeUrl = str_replace("*", $randstr, $subscribeUrl);
|
||||
} elseif (strpos($subscribeUrl, "[uuid]") !== false) {
|
||||
} elseif (strpos($subscribeUrl, '{uuid}') !== false) {
|
||||
$user = User::where('token', $token)->first();
|
||||
$subscribeUrl = str_replace("*", $user->uuid, $subscribeUrl);
|
||||
$subscribeUrl = str_replace('{uuid}', $user->uuid, $subscribeUrl);
|
||||
}
|
||||
}
|
||||
return $subscribeUrl ? rtrim($subscribeUrl, '/') . $path : url($path);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user