Authored by 郝肖肖

special http

... ... @@ -27,9 +27,9 @@
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
<link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/1.3.16/index.css">
<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
<link rel="apple-touch-icon-precomposed" href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="//static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="//static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body >
<header id="yoho-header" class="yoho-header boys">
... ... @@ -95,8 +95,8 @@
</a>
</div>
<script src="http://cdn.yoho.cn/myohobuy/1.3.16/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/1.3.16/index.js"></script>
<script src="//cdn.yoho.cn/myohobuy/1.3.16/lib.js"></script>
<script src="//cdn.yoho.cn/myohobuy/1.3.16/index.js"></script>
<script type="text/javascript">
(function(w,d,s,j,f){
... ... @@ -107,7 +107,7 @@
a.async=1;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js','_yas');
})(window,document,'script','//cdn.yoho.cn/yas-jssdk/1.0.14/yas.js','_yas');
</script>
<script>
seajs.use('js/common');
... ... @@ -123,5 +123,5 @@
})(window,document,'script','dataLayer','GTM-W958MG');
</script>
<script src="http://static.yohobuy.com/js/analytics/analysis.js"></script>
<script src="//static.yohobuy.com/js/analytics/analysis.js"></script>
</html>
\ No newline at end of file
... ...
... ... @@ -27,9 +27,9 @@
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
<link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/1.3.16/index.css">
<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
<link rel="apple-touch-icon-precomposed" href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="//static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="//static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body class=passport-body>
<div class="login-page passport-page yoho-page">
... ...
... ... @@ -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
*/
... ...
... ... @@ -72,7 +72,7 @@ class Images
if (stripos($fileName, 'http://') !== 0) {
$fileName = self::template($fileName, $bucket, $mode);
}
return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
return Helpers::getUrlSafe(strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)));
}
/**
... ...
... ... @@ -52,7 +52,7 @@ class Service extends PayAbstract
'partner' => $this->config->partner,
'_input_charset' => $this->config->input_charset,
'notify_url' => SERVICE_NOTIFY . $this->config->notify_url,
'return_url' => Helpers::url($this->config->return_url),
'return_url' => Helpers::getHttpOrHttps() . Helpers::url($this->config->return_url),
/* 业务参数 */
'subject' => $params->goodsName,
'out_trade_no' => $params->orderCode,
... ...