From 08b571c9d0843b19115bd9bb892cb141c508ea3b Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 17 Feb 2014 14:30:02 -0800 Subject: project "snakebite" --- include/photo/photo_driver.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include/photo') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index c2eeafa54..484550cb7 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -538,14 +538,20 @@ function import_profile_photo($photo,$xchan,$thing = false) { } $photo_failure = false; + $img_str = ''; + if($photo) { + $filename = basename($photo); + $type = guess_image_type($photo,true); - $filename = basename($photo); - $type = guess_image_type($photo,true); - $result = z_fetch_url($photo,true); + if(! $type) + $type = 'image/jpeg'; - if($result['success']) - $img_str = $result['body']; + $result = z_fetch_url($photo,true); + + if($result['success']) + $img_str = $result['body']; + } $img = photo_factory($img_str, $type); if($img->is_valid()) { -- cgit v1.2.3