Authored by hf

modify Images.php use regex to php function

... ... @@ -67,7 +67,7 @@ class Helpers
*/
public static function getFilterUrl($url)
{
$url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN));
$url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN));
$filter = strstr($url, 'openby:yohobuy=', true);
if ($filter) {
return rtrim(rtrim($filter, '?'), '&');
... ...
... ... @@ -48,7 +48,7 @@ class Images
*/
public static function getSourceUrl($fileName, $bucket = 'yhfair')
{
if(preg_match('|http://|', $fileName)){
if(stripos($fileName, 'http://') === 0){
return $fileName;
}
$domain = self::getDomain($bucket, $fileName);
... ...