]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
retaining compatibility with previous TwitterBridge getMediatype
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 24 May 2012 21:08:40 +0000 (23:08 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 24 May 2012 21:08:40 +0000 (23:08 +0200)
plugins/TwitterBridge/twitterimport.php

index 2b8055b1263134e3899420cb1eb9d3455e95671b..4d165d4dd25f7f64a01b687ecd07cfb624743994 100644 (file)
@@ -369,7 +369,7 @@ class TwitterImport
 
         $ext = (isset($path_parts['extension']) ? '.'.$path_parts['extension'] : '');  // some lack extension
         $img_root = basename($path_parts['basename'], '_normal'.$ext); // cut off extension
-        $mediatype = $this->getMediatype($ext);
+        $mediatype = $this->getMediatype(substr($ext, 1));
 
         foreach (array('mini', 'normal', 'bigger') as $size) {
             $url = $path_parts['dirname'] . '/' .
@@ -398,10 +398,10 @@ class TwitterImport
         $mediatype = null;
 
         switch (strtolower($ext)) {
-        case '.jpg':
+        case 'jpg':
             $mediatype = 'image/jpg';
             break;
-        case '.gif':
+        case 'gif':
             $mediatype = 'image/gif';
             break;
         default:
@@ -418,7 +418,7 @@ class TwitterImport
         $path_parts = pathinfo($user->profile_image_url);
         $ext = (isset($path_parts['extension']) ? '.'.$path_parts['extension'] : '');
         $img_root = basename($path_parts['basename'], '_normal'.$ext);
-        $mediatype = $this->getMediatype($ext);
+        $mediatype = $this->getMediatype(substr($ext, 1));
 
         foreach (array('mini', 'normal', 'bigger') as $size) {
             $url = $path_parts['dirname'] . '/' .