From: Laury GvR Date: Mon, 26 Jun 2017 19:12:43 +0000 (-0400) Subject: Prevent imageUpload model from stripping images if the source is a URL, on account... X-Git-Tag: v2.10.0^2~14 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=2962144223507bc37d48f9fcf7bf28dfe85d9214;p=WP-Plugins%2Fglm-member-db.git Prevent imageUpload model from stripping images if the source is a URL, on account of the import script --- diff --git a/models/admin/ajax/imageUpload.php b/models/admin/ajax/imageUpload.php index 85c771b9..fd2ba6af 100644 --- a/models/admin/ajax/imageUpload.php +++ b/models/admin/ajax/imageUpload.php @@ -181,8 +181,11 @@ class GlmMembersAdmin_ajax_imageUpload extends GlmDataImages ); } - // Strip meta data off image - this prevents EXIF orientation shenanigans - $file['tmp_name'] = $this->stripImageMeta($file['tmp_name']); + // If the image resource is a url (from the import script) then don't try to strip it + if (!filter_var($file['tmp_name'], FILTER_VALIDATE_URL)) { + // Strip meta data off image - this prevents EXIF orientation shenanigans + $file['tmp_name'] = $this->stripImageMeta($file['tmp_name']); + } // Get the desired file name and add a timestamp to it to ensure that it's unique $fInfo = pathinfo($file['name']);