mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Add type declarations, fix function reference
This commit is contained in:
@@ -13,9 +13,9 @@ class RedirectController {
|
||||
$term = trim($_GET['term']);
|
||||
switch ($_GET['type']) {
|
||||
case 'url':
|
||||
$endpoint = to_endpoint($term);
|
||||
$endpoint = self::to_endpoint($term);
|
||||
if (!$endpoint) {
|
||||
ErrorHandler::show('Invalid or unknown TikTok URL format');
|
||||
echo 'Invalid or unknown TikTok URL format';
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -51,7 +51,7 @@ class RedirectController {
|
||||
/**
|
||||
* to_endpoint maps a TikTok URL into a ProxiTok-compatible endpoint URL.
|
||||
*/
|
||||
static private function to_endpoint($url) {
|
||||
static private function to_endpoint(string $url): string {
|
||||
if (preg_match('%^https://vm\.tiktok\.com/([A-Za-z0-9]+)%', $url, $m)) {
|
||||
// Short video URL
|
||||
return '/@placeholder/video/' . $m[1];
|
||||
|
||||
Reference in New Issue
Block a user