mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
PT-Gen change isIdValid to isUrlValid
This commit is contained in:
@@ -100,8 +100,8 @@ class PTGen
|
|||||||
throw new PTGenException("not support site: $site, only support: " . implode(", ", array_keys(self::$validSites)));
|
throw new PTGenException("not support site: $site, only support: " . implode(", ", array_keys(self::$validSites)));
|
||||||
}
|
}
|
||||||
$siteInfo = self::$validSites[$site];
|
$siteInfo = self::$validSites[$site];
|
||||||
$isIdValid = preg_match($siteInfo['url_pattern'], $url, $matches);
|
$isUrlValid = preg_match($siteInfo['url_pattern'], $url, $matches);
|
||||||
if (!$isIdValid) {
|
if (!$isUrlValid) {
|
||||||
throw new PTGenException("invalid url: $url");
|
throw new PTGenException("invalid url: $url");
|
||||||
}
|
}
|
||||||
return sprintf('%s/?site=%s&sid=%s', trim($this->apiPoint, '/'), $site , $matches[1]);
|
return sprintf('%s/?site=%s&sid=%s', trim($this->apiPoint, '/'), $site , $matches[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user