]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/StoreRemoteMedia/StoreRemoteMediaPlugin.php
Merge branch 'master' of git.gnu.io:gnu/gnu-social into mmn_fixes
[quix0rs-gnu-social.git] / plugins / StoreRemoteMedia / StoreRemoteMediaPlugin.php
index 650f27c21fd75c571210571aa51146155d936e08..e171218f79ffc6868abfe82e91f8e1d471c9e147 100644 (file)
@@ -55,7 +55,7 @@ class StoreRemoteMediaPlugin extends Plugin
         switch (common_get_mime_media($file->mimetype)) {
         case 'image':
             // Just to set something for now at least...
-            $file->title = $file->mimetype;
+            //$file->title = $file->mimetype;
             break;
         }
         
@@ -91,7 +91,7 @@ class StoreRemoteMediaPlugin extends Plugin
             $http = new HTTPClient();
             common_debug(sprintf('Performing HEAD request for remote file id==%u to avoid unnecessarily downloading too large files. URL: %s', $file->getID(), $remoteUrl));
             $head = $http->head($remoteUrl);
-            $remoteUrl = $head->effectiveUrl;   // to avoid going through redirects again
+            $remoteUrl = $head->getEffectiveUrl();   // to avoid going through redirects again
             if (!$this->checkBlackList($remoteUrl)) {
                 common_log(LOG_WARN, sprintf('%s: Non-blacklisted URL %s redirected to blacklisted URL %s', __CLASS__, $file->getUrl(), $remoteUrl));
                 return true;
@@ -120,7 +120,7 @@ class StoreRemoteMediaPlugin extends Plugin
             common_debug(sprintf('Downloading remote file id==%u (should be size %u) with effective URL: %s', $file->getID(), $filesize, _ve($remoteUrl)));
             $imgData = HTTPClient::quickGet($remoteUrl);
         } catch (HTTP_Request2_ConnectionException $e) {
-            common_log(LOG_ERR, __CLASS__.': quickGet on URL: '._ve($file->getUrl()).' threw exception: '.$e->getMessage());
+            common_log(LOG_ERR, __CLASS__.': '._ve(get_class($e)).' on URL: '._ve($file->getUrl()).' threw exception: '.$e->getMessage());
             return true;
         }
         $info = @getimagesizefromstring($imgData);