Authored by 郝肖肖

分流条件判断

@@ -141,10 +141,10 @@ class Yohobuy @@ -141,10 +141,10 @@ class Yohobuy
141 $urlBack = $url; 141 $urlBack = $url;
142 142
143 if (USE_INTER_FACE_SHUNT) { 143 if (USE_INTER_FACE_SHUNT) {
144 - if (strpos($url, API_URL)) { 144 + if (strpos($url, API_URL) >= 0) {
145 $isApi = true; 145 $isApi = true;
146 $url = self::_getUrl($url, $data); 146 $url = self::_getUrl($url, $data);
147 - } else if (strpos($url, SERVICE_URL)) { 147 + } else if (strpos($url, SERVICE_URL) >= 0) {
148 $isService = true; 148 $isService = true;
149 $url = self::_getUrl($url, $data); 149 $url = self::_getUrl($url, $data);
150 } 150 }
@@ -293,10 +293,10 @@ class Yohobuy @@ -293,10 +293,10 @@ class Yohobuy
293 $urlBack = $url; 293 $urlBack = $url;
294 294
295 if (USE_INTER_FACE_SHUNT) { 295 if (USE_INTER_FACE_SHUNT) {
296 - if (strpos($url, API_URL)) { 296 + if (strpos($url, API_URL) >= 0) {
297 $isApi = true; 297 $isApi = true;
298 $url = self::_getUrl($url, $data); 298 $url = self::_getUrl($url, $data);
299 - } else if (strpos($url, SERVICE_URL)) { 299 + } else if (strpos($url, SERVICE_URL) >= 0) {
300 $isService = true; 300 $isService = true;
301 $url = self::_getUrl($url, $data); 301 $url = self::_getUrl($url, $data);
302 } 302 }
@@ -731,7 +731,7 @@ class Yohobuy @@ -731,7 +731,7 @@ class Yohobuy
731 } 731 }
732 732
733 $paseUrl = parse_url($url); 733 $paseUrl = parse_url($url);
734 - if (strpos($url, API_URL)) { 734 + if (strpos($url, API_URL) >= 0) {
735 735
736 if (empty($ips['api.yoho.cn'])) { 736 if (empty($ips['api.yoho.cn'])) {
737 return false; 737 return false;
@@ -745,7 +745,7 @@ class Yohobuy @@ -745,7 +745,7 @@ class Yohobuy
745 745
746 $url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/'; 746 $url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/';
747 747
748 - } else if (strpos($url, SERVICE_URL)) { 748 + } else if (strpos($url, SERVICE_URL) >= 0) {
749 749
750 if (empty($ips['service.yoho.cn'])) { 750 if (empty($ips['service.yoho.cn'])) {
751 return false; 751 return false;