Authored by hf

modify Images.php use regex to php function

... ... @@ -152,7 +152,8 @@ class Helpers
$result['price'] = $productData['market_price'];
$result['salePrice'] = $productData['sales_price'];
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = OLD_MAIN . '/product/pro_' . $productData['product_id'] . '_' . $productData['goods_list'][0]['goods_id']
$result['url'] = OLD_MAIN . '/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
. '/'. $productData['cn_alphabet'] . '.html';
if ($showTags) {
... ...
... ... @@ -66,7 +66,7 @@ class Images
*/
public static function getImageUrl($fileName, $width, $height, $mode = 1, $bucket = 'goodsimg')
{
if(!preg_match('|http://|', $fileName)){
if (stripos($fileName, 'http://') !== 0){
$fileName = self::template($fileName, $bucket, $mode);
}
return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode));
... ...