aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-03 17:40:31 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-03 17:40:31 -0800
commit6aa98a1e91dde244f94d7c22a8137b55c5d7b189 (patch)
treed310a10287a5c2773102742464fa877e6232b6b5 /include
parent14b74069f889862b4d2f8510ae828a51bdfaaa8d (diff)
parent52120b367ab99d1f7a96aa9e3a1f5ef5176a1ce5 (diff)
downloadvolse-hubzilla-6aa98a1e91dde244f94d7c22a8137b55c5d7b189.tar.gz
volse-hubzilla-6aa98a1e91dde244f94d7c22a8137b55c5d7b189.tar.bz2
volse-hubzilla-6aa98a1e91dde244f94d7c22a8137b55c5d7b189.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'include')
-rw-r--r--include/photo/photo_driver.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index bbcc110c8..96bde7587 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -593,15 +593,24 @@ function import_profile_photo($photo,$xchan,$thing = false) {
if($photo) {
$filename = basename($photo);
- $type = guess_image_type($photo);
-
- if(! $type)
- $type = 'image/jpeg';
$result = z_fetch_url($photo,true);
- if($result['success'])
+ if($result['success']) {
$img_str = $result['body'];
+ $type = guess_image_type($photo, $result['header']);
+
+ $h = explode("\n",$result['header']);
+ if($h) {
+ foreach($h as $hl) {
+ if(stristr($hl,'content-type:')) {
+ if(! stristr($hl,'image/')) {
+ $photo_failure = true;
+ }
+ }
+ }
+ }
+ }
}
$img = photo_factory($img_str, $type);