Authored by 郝肖肖

防止多次调用getImageUrl

@@ -66,6 +66,11 @@ class Images @@ -66,6 +66,11 @@ class Images
66 */ 66 */
67 public static function getImageUrl($fileName, $width, $height, $mode = 2, $bucket = 'goodsimg') 67 public static function getImageUrl($fileName, $width, $height, $mode = 2, $bucket = 'goodsimg')
68 { 68 {
  69 + if (substr($fileName, 0, 2) === '//') {
  70 + //防止多次调用getImageUrl
  71 + $fileName = 'http:' . $fileName;
  72 + }
  73 +
69 if (!is_string($fileName)) { 74 if (!is_string($fileName)) {
70 return self::template(self::$default_image, $bucket, $mode); 75 return self::template(self::$default_image, $bucket, $mode);
71 } 76 }