From e4394b6f2e2390f7f1621ea04b4a63dd0167d328 Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Mon, 4 Dec 2017 18:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=8E=9F=E5=9B=BE=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=97=B6=E8=BF=94=E5=9B=9E=20placeholder.png=20?= =?UTF-8?q?=E7=9A=84=20cache=20=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/admin/model/tool/image.php | 14 ++++++++------ upload/catalog/model/tool/image.php | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/upload/admin/model/tool/image.php b/upload/admin/model/tool/image.php index 3c128eaa..70b1d755 100644 --- a/upload/admin/model/tool/image.php +++ b/upload/admin/model/tool/image.php @@ -1,22 +1,22 @@ filemtime(DIR_IMAGE . $image_new))) { list($width_orig, $height_orig, $image_type) = getimagesize(DIR_IMAGE . $image_old); - - if (!in_array($image_type, array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF))) { + + if (!in_array($image_type, array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF))) { return DIR_IMAGE . $image_old; } - + $path = ''; $directories = explode('/', dirname($image_new)); @@ -38,6 +38,8 @@ class ModelToolImage extends Model { } } + $image_new = str_replace(' ', '%20', $image_new); // fix bug when attach image on email (gmail.com). it is automatic changing space " " to + + return HTTP_CATALOG . 'image/' . $image_new; } } diff --git a/upload/catalog/model/tool/image.php b/upload/catalog/model/tool/image.php index 480fcd51..ceb56a03 100644 --- a/upload/catalog/model/tool/image.php +++ b/upload/catalog/model/tool/image.php @@ -1,8 +1,8 @@