Prevent imageUpload model from stripping images if the source is a URL, on account...
authorLaury GvR <laury@gaslightmedia.com>
Mon, 26 Jun 2017 19:12:43 +0000 (15:12 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 26 Jun 2017 19:12:43 +0000 (15:12 -0400)
models/admin/ajax/imageUpload.php

index 85c771b..fd2ba6a 100644 (file)
@@ -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']);