Authored by 郝肖肖

strpos 强制类型判断

... ... @@ -141,10 +141,10 @@ class Yohobuy
$urlBack = $url;
if (USE_INTER_FACE_SHUNT) {
if (strpos($url, API_URL) >= 0) {
if (strpos($url, API_URL) !== false) {
$isApi = true;
$url = self::_getUrl($url, $data);
} else if (strpos($url, SERVICE_URL) >= 0) {
} else if (strpos($url, SERVICE_URL) !== false) {
$isService = true;
$url = self::_getUrl($url, $data);
}
... ... @@ -293,10 +293,10 @@ class Yohobuy
$urlBack = $url;
if (USE_INTER_FACE_SHUNT) {
if (strpos($url, API_URL) >= 0) {
if (strpos($url, API_URL) !== false) {
$isApi = true;
$url = self::_getUrl($url, $data);
} else if (strpos($url, SERVICE_URL) >= 0) {
} else if (strpos($url, SERVICE_URL) !== false) {
$isService = true;
$url = self::_getUrl($url, $data);
}
... ... @@ -731,7 +731,7 @@ class Yohobuy
}
$paseUrl = parse_url($url);
if (strpos($url, API_URL) >= 0) {
if (strpos($url, API_URL) !== false) {
if (empty($ips['api.yoho.cn'])) {
return false;
... ... @@ -745,7 +745,7 @@ class Yohobuy
$url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/';
} else if (strpos($url, SERVICE_URL) >= 0) {
} else if (strpos($url, SERVICE_URL) !== false) {
if (empty($ips['service.yoho.cn'])) {
return false;
... ...