Authored by 郝肖肖

special http

@@ -27,9 +27,9 @@ @@ -27,9 +27,9 @@
27 <link rel="dns-prefetch" href="//img12.static.yhbimg.com"> 27 <link rel="dns-prefetch" href="//img12.static.yhbimg.com">
28 <link rel="dns-prefetch" href="//img13.static.yhbimg.com"> 28 <link rel="dns-prefetch" href="//img13.static.yhbimg.com">
29 <link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/1.3.16/index.css"> 29 <link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/1.3.16/index.css">
30 - <link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">  
31 - <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)">  
32 - <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)"> 30 + <link rel="apple-touch-icon-precomposed" href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
  31 + <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)">
  32 + <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)">
33 </head> 33 </head>
34 <body > 34 <body >
35 <header id="yoho-header" class="yoho-header boys"> 35 <header id="yoho-header" class="yoho-header boys">
@@ -95,8 +95,8 @@ @@ -95,8 +95,8 @@
95 </a> 95 </a>
96 </div> 96 </div>
97 97
98 -<script src="http://cdn.yoho.cn/myohobuy/1.3.16/lib.js"></script>  
99 -<script src="http://cdn.yoho.cn/myohobuy/1.3.16/index.js"></script> 98 +<script src="//cdn.yoho.cn/myohobuy/1.3.16/lib.js"></script>
  99 +<script src="//cdn.yoho.cn/myohobuy/1.3.16/index.js"></script>
100 100
101 <script type="text/javascript"> 101 <script type="text/javascript">
102 (function(w,d,s,j,f){ 102 (function(w,d,s,j,f){
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
107 a.async=1; 107 a.async=1;
108 a.src=j; 108 a.src=j;
109 m.parentNode.insertBefore(a,m); 109 m.parentNode.insertBefore(a,m);
110 - })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js','_yas'); 110 + })(window,document,'script','//cdn.yoho.cn/yas-jssdk/1.0.14/yas.js','_yas');
111 </script> 111 </script>
112 <script> 112 <script>
113 seajs.use('js/common'); 113 seajs.use('js/common');
@@ -123,5 +123,5 @@ @@ -123,5 +123,5 @@
123 })(window,document,'script','dataLayer','GTM-W958MG'); 123 })(window,document,'script','dataLayer','GTM-W958MG');
124 </script> 124 </script>
125 125
126 -<script src="http://static.yohobuy.com/js/analytics/analysis.js"></script> 126 +<script src="//static.yohobuy.com/js/analytics/analysis.js"></script>
127 </html> 127 </html>
@@ -27,9 +27,9 @@ @@ -27,9 +27,9 @@
27 <link rel="dns-prefetch" href="//img12.static.yhbimg.com"> 27 <link rel="dns-prefetch" href="//img12.static.yhbimg.com">
28 <link rel="dns-prefetch" href="//img13.static.yhbimg.com"> 28 <link rel="dns-prefetch" href="//img13.static.yhbimg.com">
29 <link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/1.3.16/index.css"> 29 <link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/1.3.16/index.css">
30 - <link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">  
31 - <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)">  
32 - <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)"> 30 + <link rel="apple-touch-icon-precomposed" href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
  31 + <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)">
  32 + <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)">
33 </head> 33 </head>
34 <body class=passport-body> 34 <body class=passport-body>
35 <div class="login-page passport-page yoho-page"> 35 <div class="login-page passport-page yoho-page">
@@ -62,7 +62,7 @@ class Helpers @@ -62,7 +62,7 @@ class Helpers
62 */ 62 */
63 public static function getImageUrl($url, $width, $height, $mode = 2) 63 public static function getImageUrl($url, $width, $height, $mode = 2)
64 { 64 {
65 - return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//')); 65 + return self::getUrlSafe(strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)));
66 } 66 }
67 67
68 /** 68 /**
@@ -73,7 +73,7 @@ class Helpers @@ -73,7 +73,7 @@ class Helpers
73 */ 73 */
74 public static function getFilterUrl($url) 74 public static function getFilterUrl($url)
75 { 75 {
76 - $url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN, 'http://' => '//')); 76 + $url = self::getUrlSafe(strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN)));
77 $filter = strstr($url, 'openby:yohobuy=', true); 77 $filter = strstr($url, 'openby:yohobuy=', true);
78 if ($filter) { 78 if ($filter) {
79 return rtrim(rtrim($filter, '?'), '&'); 79 return rtrim(rtrim($filter, '?'), '&');
@@ -985,9 +985,9 @@ class Helpers @@ -985,9 +985,9 @@ class Helpers
985 public static function logoutSession($token, $refer = '', $callback = 'call') 985 public static function logoutSession($token, $refer = '', $callback = 'call')
986 { 986 {
987 if(APPLICATION_ENV == 'production' || APPLICATION_ENV == 'preview' ) { 987 if(APPLICATION_ENV == 'production' || APPLICATION_ENV == 'preview' ) {
988 - $domain = '//mapi.yohobuy.com'; 988 + $domain = 'http://mapi.yohobuy.com';
989 } else { 989 } else {
990 - $domain = '//m1.yohobuy.com'; 990 + $domain = 'http://m1.yohobuy.com';
991 } 991 }
992 return $domain.'/Passport/session/logout?callback=' . $callback 992 return $domain.'/Passport/session/logout?callback=' . $callback
993 . '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer; 993 . '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer;
@@ -1109,10 +1109,29 @@ class Helpers @@ -1109,10 +1109,29 @@ class Helpers
1109 */ 1109 */
1110 public static function getUrlSafe($url) 1110 public static function getUrlSafe($url)
1111 { 1111 {
  1112 + if (self::isStrpos(array('/special_', '/special/'), $url)) {
  1113 + return $url;
  1114 + }
1112 return strtr($url, array('http://' => '//')); 1115 return strtr($url, array('http://' => '//'));
1113 } 1116 }
1114 1117
1115 /** 1118 /**
  1119 + * 查找数组是否包含字符串中
  1120 + * @param type $array 要查找的数组
  1121 + * @param type $str 要搜索的字符串
  1122 + * @return boolean
  1123 + */
  1124 + public static function isStrpos($array = array(), $str = '')
  1125 + {
  1126 + foreach ($array as $val) {
  1127 + if (strpos($str, $val) !== false) {
  1128 + return true;
  1129 + }
  1130 + }
  1131 + return false;
  1132 + }
  1133 +
  1134 + /**
1116 * 获取当前页面是http还是https 1135 * 获取当前页面是http还是https
1117 * @return string 1136 * @return string
1118 */ 1137 */
@@ -72,7 +72,7 @@ class Images @@ -72,7 +72,7 @@ class Images
72 if (stripos($fileName, 'http://') !== 0) { 72 if (stripos($fileName, 'http://') !== 0) {
73 $fileName = self::template($fileName, $bucket, $mode); 73 $fileName = self::template($fileName, $bucket, $mode);
74 } 74 }
75 - return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//')); 75 + return Helpers::getUrlSafe(strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)));
76 } 76 }
77 77
78 /** 78 /**
@@ -52,7 +52,7 @@ class Service extends PayAbstract @@ -52,7 +52,7 @@ class Service extends PayAbstract
52 'partner' => $this->config->partner, 52 'partner' => $this->config->partner,
53 '_input_charset' => $this->config->input_charset, 53 '_input_charset' => $this->config->input_charset,
54 'notify_url' => SERVICE_NOTIFY . $this->config->notify_url, 54 'notify_url' => SERVICE_NOTIFY . $this->config->notify_url,
55 - 'return_url' => Helpers::url($this->config->return_url), 55 + 'return_url' => Helpers::getHttpOrHttps() . Helpers::url($this->config->return_url),
56 /* 业务参数 */ 56 /* 业务参数 */
57 'subject' => $params->goodsName, 57 'subject' => $params->goodsName,
58 'out_trade_no' => $params->orderCode, 58 'out_trade_no' => $params->orderCode,