...
|
...
|
@@ -62,7 +62,7 @@ class Helpers |
|
|
*/
|
|
|
public static function getImageUrl($url, $width, $height, $mode = 2)
|
|
|
{
|
|
|
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
|
|
|
return self::getUrlSafe(strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)));
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -73,7 +73,7 @@ class Helpers |
|
|
*/
|
|
|
public static function getFilterUrl($url)
|
|
|
{
|
|
|
$url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN, 'http://' => '//'));
|
|
|
$url = self::getUrlSafe(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, '?'), '&');
|
...
|
...
|
@@ -985,9 +985,9 @@ class Helpers |
|
|
public static function logoutSession($token, $refer = '', $callback = 'call')
|
|
|
{
|
|
|
if(APPLICATION_ENV == 'production' || APPLICATION_ENV == 'preview' ) {
|
|
|
$domain = '//mapi.yohobuy.com';
|
|
|
$domain = 'http://mapi.yohobuy.com';
|
|
|
} else {
|
|
|
$domain = '//m1.yohobuy.com';
|
|
|
$domain = 'http://m1.yohobuy.com';
|
|
|
}
|
|
|
return $domain.'/Passport/session/logout?callback=' . $callback
|
|
|
. '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer;
|
...
|
...
|
@@ -1109,10 +1109,29 @@ class Helpers |
|
|
*/
|
|
|
public static function getUrlSafe($url)
|
|
|
{
|
|
|
if (self::isStrpos(array('/special_', '/special/'), $url)) {
|
|
|
return $url;
|
|
|
}
|
|
|
return strtr($url, array('http://' => '//'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查找数组是否包含字符串中
|
|
|
* @param type $array 要查找的数组
|
|
|
* @param type $str 要搜索的字符串
|
|
|
* @return boolean
|
|
|
*/
|
|
|
public static function isStrpos($array = array(), $str = '')
|
|
|
{
|
|
|
foreach ($array as $val) {
|
|
|
if (strpos($str, $val) !== false) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取当前页面是http还是https
|
|
|
* @return string
|
|
|
*/
|
...
|
...
|
|