Skip to content

Commit

Permalink
Don't screw up on images that are ".jpeg" instead of ".jpg"
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 30, 2014
1 parent d92bf4c commit 263b9f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cachetweets.php
Expand Up @@ -7,6 +7,10 @@ function embed_img_url($mediaurl)
{
$imgdata = false;
$imgtype = (strlen($mediaurl) > 4) ? strtolower(substr($mediaurl, -4)) : '';

if ($imgtype == '.jpeg')
$imgtype = '.jpg';

if (($imgtype == '.jpg') || ($imgtype == '.png') || ($imgtype == '.gif'))
{
$imgdata = file_get_contents($mediaurl);
Expand Down

0 comments on commit 263b9f2

Please sign in to comment.