From: Mikael Nordfeldth Date: Thu, 24 May 2012 21:08:40 +0000 (+0200) Subject: retaining compatibility with previous TwitterBridge getMediatype X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b2a91944bbab6fd5a1741d7b0bcd08c983ab04c5;p=quix0rs-gnu-social.git retaining compatibility with previous TwitterBridge getMediatype --- diff --git a/plugins/TwitterBridge/twitterimport.php b/plugins/TwitterBridge/twitterimport.php index 2b8055b126..4d165d4dd2 100644 --- a/plugins/TwitterBridge/twitterimport.php +++ b/plugins/TwitterBridge/twitterimport.php @@ -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'] . '/' .