X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphoto.php;h=7f13d1cbf83db67d765ccf3d6c527f2b81bd9c1c;hb=fbb635462a5a1f371801741b03b1ecef623d9323;hp=6e4d981d27f2484876a376c6259a10609d97ed9f;hpb=d090033a0aab7197af9dc7f3e2cf21ebdf042b21;p=friendica.git diff --git a/mod/photo.php b/mod/photo.php index 6e4d981d27..7f13d1cbf8 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -13,18 +13,25 @@ function photo_init(&$a) { case 1: default: killme(); - return; // NOTREACHED + // NOTREACHED } - if(x($type)) { + $default = 'images/default-profile.jpg'; + + if(isset($type)) { switch($type) { case 'profile': $resolution = 4; break; + case 'micro': + $resolution = 6; + $default = 'images/default-profile-mm.jpg'; + break; case 'avatar': default: $resolution = 5; + $default = 'images/default-profile-sm.jpg'; break; } @@ -37,10 +44,8 @@ function photo_init(&$a) { if(count($r)) { $data = $r[0]['data']; } - if(x($data) === false) { - $data = file_get_contents(($resolution == 5) - ? 'images/default-profile-sm.jpg' - : 'images/default-profile.jpg'); + if(! isset($data)) { + $data = file_get_contents($default); } } else { @@ -106,13 +111,13 @@ function photo_init(&$a) { } } - if(x($data) === false) { + if(! isset($data)) { killme(); - return; // NOTREACHED + // NOTREACHED } - header("Content-type: image/jpeg"); - echo $data; + header("Content-type: image/jpeg"); + echo $data; killme(); - return; //NOTREACHED + // NOTREACHED } \ No newline at end of file