Authored by 郝肖肖

基础模板 水牌位 https

... ... @@ -943,10 +943,6 @@ class Helpers
*/
public static function getUrlSafe($url)
{
if (stripos($url, 'http://') !== false) {
return '//' . ltrim(strtr($url, array('http://' => '', 'https://' => '')), '//');
}
return $url;
return strtr($url, array('http://' => '//', 'https://' => '//'));
}
}
... ...
... ... @@ -752,6 +752,8 @@ class HelperSearch
$color = $filter['color'];
if (isset($color['color_id'])) {
$checked = isset(self::$params['color']) && self::$params['color'] ==$color['color_id'] ? true : false;
$color['color_value'] = empty($color['color_value']) ? '' : Helpers::getUrlSafe($color['color_value']);
$result[] = array(
'name' => $color['color_name'],
'rgb' => empty($color['color_value']) ? '#' . $color['color_code'] : "url({$color['color_value']})",
... ... @@ -765,6 +767,7 @@ class HelperSearch
else {
foreach ($color as $v) {
$checked = false;
$v['color_value'] = empty($v['color_value']) ? '' : Helpers::getUrlSafe($v['color_value']);
//设置已选中
if ($v['color_id'] == $colorId) {
$background = empty($v['color_value']) ? '#' . $v['color_code'] : "url(" . $v['color_value'] . ")";
... ...
... ... @@ -1109,10 +1109,6 @@ class Helpers
*/
public static function getUrlSafe($url)
{
if (stripos($url, 'http://') !== false) {
return '//' . ltrim(strtr($url, array('http://' => '', 'https://' => '')), '//');
}
return $url;
return strtr($url, array('http://' => '//', 'https://' => '//'));
}
}
... ...
... ... @@ -163,7 +163,7 @@ class BrandsModel
if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
$result['brandId'] = isset($brandInfo['data']['id']) ? $brandInfo['data']['id'] : '';
$result['node'] = isset($brandInfo['data']['static_content_code']) ? $brandInfo['data']['static_content_code'] : false;
$result['brandBanner'] = isset($brandInfo['data']['brand_banner']) ? $brandInfo['data']['brand_banner'] : '';
$result['brandBanner'] = isset($brandInfo['data']['brand_banner']) ? Helpers::getUrlSafe($brandInfo['data']['brand_banner']) : '';
$result['brandNameEn'] = isset($brandInfo['data']['brand_name_en']) ? $brandInfo['data']['brand_name_en'] : '';
$result['brandNameCn'] = isset($brandInfo['data']['brand_name_cn']) ? $brandInfo['data']['brand_name_cn'] : '';
$result['brandAbout'] = isset($brandInfo['data']['brand_intro']) ? $brandInfo['data']['brand_intro'] : '';
... ... @@ -197,7 +197,7 @@ class BrandsModel
if (isset($series['data']) && $series['code'] === 200) {
foreach ($series['data'] as $value) {
$result['list'][$index]['href'] = '?series=' . $value['id'];
$result['list'][$index]['src'] = $value['series_banner'];
$result['list'][$index]['src'] = Helpers::getUrlSafe($value['series_banner']);
++ $index;
}
//title设置为经典系列
... ... @@ -207,7 +207,7 @@ class BrandsModel
if (isset($advNav['data']) && $advNav['code'] === 200) {
foreach ($advNav['data'] as $value) {
$result['list'][$index]['href'] = '?folder_id=' . $value['id'];
$result['list'][$index]['src'] = $value['brand_sort_ico'];
$result['list'][$index]['src'] = Helpers::getUrlSafe($value['brand_sort_ico']);
++ $index;
}
//title设置为经典系列
... ...
... ... @@ -132,14 +132,13 @@ class IndexController extends WebAction
return '';
}
$node = $this->post('node');
//$mode = $this->post('mode');
if (!isset($node)) {
return '';
}
$nodeContent = BrandData::getByNodeContent($node);
if (isset($nodeContent['code']) && $nodeContent['code'] == 200) {
echo '<br>', $nodeContent['data'];
echo '<br>', Helpers::getUrlSafe($nodeContent['data']);
}
}
... ...