aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2018-11-13 11:38:49 +0100
committerMax Kostikov <max@kostikov.co>2018-11-13 11:38:49 +0100
commit286326a98e8d5de102ce58eee581c6c2e9fa6c06 (patch)
tree76c27f86a090ae77a304e3d16773a88be94f8492
parent2f59d7873789885d4311d99db7fa6bce9f212810 (diff)
downloadvolse-hubzilla-286326a98e8d5de102ce58eee581c6c2e9fa6c06.tar.gz
volse-hubzilla-286326a98e8d5de102ce58eee581c6c2e9fa6c06.tar.bz2
volse-hubzilla-286326a98e8d5de102ce58eee581c6c2e9fa6c06.zip
Replace fetch_image_from_url() with z_fetch_url()
-rw-r--r--Zotlabs/Module/Photo.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index 95e3404fb..68cd7c4ac 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -89,9 +89,8 @@ class Photo extends \Zotlabs\Web\Controller {
}
if(! $data) {
- $data = fetch_image_from_url($default,$mimetype);
- }
- if(! $mimetype) {
+ $x = z_fetch_url($default,true,0,[ 'novalidate' => true ]);
+ $data = ($x['success'] ? $x['body'] : EMPTY_STR);
$mimetype = 'image/png';
}
}
@@ -200,19 +199,22 @@ class Photo extends \Zotlabs\Web\Controller {
if(isset($resolution)) {
switch($resolution) {
case 4:
- $data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(),$mimetype);
+ $default = z_root() . '/' . get_default_profile_photo();
break;
case 5:
- $data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(80),$mimetype);
+ $default = z_root() . '/' . get_default_profile_photo(80);
break;
case 6:
- $data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(48),$mimetype);
+ $default = z_root() . '/' . get_default_profile_photo(48);
break;
default:
killme();
// NOTREACHED
break;
}
+ $x = z_fetch_url($default,true,0,[ 'novalidate' => true ]);
+ $data = ($x['success'] ? $x['body'] : EMPTY_STR);
+ $mimetype = 'image/png';
}
}