modify Images.php use regex to php function
Showing
2 changed files
with
2 additions
and
2 deletions
@@ -67,7 +67,7 @@ class Helpers | @@ -67,7 +67,7 @@ class Helpers | ||
67 | */ | 67 | */ |
68 | public static function getFilterUrl($url) | 68 | public static function getFilterUrl($url) |
69 | { | 69 | { |
70 | - $url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN)); | 70 | + $url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN)); |
71 | $filter = strstr($url, 'openby:yohobuy=', true); | 71 | $filter = strstr($url, 'openby:yohobuy=', true); |
72 | if ($filter) { | 72 | if ($filter) { |
73 | return rtrim(rtrim($filter, '?'), '&'); | 73 | return rtrim(rtrim($filter, '?'), '&'); |
@@ -48,7 +48,7 @@ class Images | @@ -48,7 +48,7 @@ class Images | ||
48 | */ | 48 | */ |
49 | public static function getSourceUrl($fileName, $bucket = 'yhfair') | 49 | public static function getSourceUrl($fileName, $bucket = 'yhfair') |
50 | { | 50 | { |
51 | - if(preg_match('|http://|', $fileName)){ | 51 | + if(stripos($fileName, 'http://') === 0){ |
52 | return $fileName; | 52 | return $fileName; |
53 | } | 53 | } |
54 | $domain = self::getDomain($bucket, $fileName); | 54 | $domain = self::getDomain($bucket, $fileName); |
-
Please register or login to post a comment