Authored by 郝肖肖

商品详情页 https

... ... @@ -943,7 +943,7 @@ class Helpers
*/
public static function getUrlSafe($url)
{
if (stripos($url, 'http://')) {
if (stripos($url, 'http://') !== false) {
return '//' . ltrim(strtr($url, array('http://' => '', 'https://' => '')), '//');
}
... ...
... ... @@ -1109,7 +1109,7 @@ class Helpers
*/
public static function getUrlSafe($url)
{
if (stripos($url, 'http://')) {
if (stripos($url, 'http://') !== false) {
return '//' . ltrim(strtr($url, array('http://' => '', 'https://' => '')), '//');
}
... ...
... ... @@ -7,7 +7,7 @@
*/
namespace WebPlugin;
use WebPlugin\Helpers;
class Images
{
... ... @@ -251,7 +251,7 @@ class Images
$imageUrl = preg_replace('@\?imageMogr2.+@is', '', $imageUrl);
}
}
return $imageUrl;
return Helpers::getUrlSafe($imageUrl);
}
/**
... ...
... ... @@ -819,7 +819,7 @@ class ItemModel
// 测量方式
if (!empty($sizeInfo['sizeImage'])) {
$size['sizeImg'] = $sizeInfo['sizeImage'];
$size['sizeImg'] = Helpers::getUrlSafe($sizeInfo['sizeImage']);
}
return $size;
}
... ...