Update for the fetch image
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 10 Jul 2017 15:49:08 +0000 (11:49 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 10 Jul 2017 15:49:08 +0000 (11:49 -0400)
Slash is already in path.
Need to ignore ssl verification.

controllers/ToolboxImport.php

index 3454563..38937ff 100644 (file)
             $filename = wp_unique_filename($path, $file);
 
             $fp = fopen($path . '/' . $filename, 'w+');
-            $fileUrl = ($baseUrl) ? $baseUrl . '/' . rawurlencode($file) : $this->_options['toolbox_image_url'] . $file;
+            $fileUrl = ($baseUrl) ? $baseUrl . rawurlencode($file) : $this->_options['toolbox_image_url'] . $file;
             $ch = curl_init($fileUrl);
             curl_setopt($ch, CURLOPT_TIMEOUT, 50);
             curl_setopt($ch, CURLOPT_FILE, $fp);
-            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+           curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+            //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
             $imgData = curl_exec($ch);
             $httpCode = curl_getinfo($ch);
             curl_close($ch);