X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphoto.php;h=3c5fdd7be4bde26b5fb375e9cbab1b8143b1bf7d;hb=5d7e1e1a1544421c594e13efb9c1ebece241e94f;hp=71c92ffe2cd98e07149a4f656753121024c1794c;hpb=5a6da8b447430174ae231a3b8203fd4bd8416cc1;p=friendica.git diff --git a/mod/photo.php b/mod/photo.php index 71c92ffe2c..3c5fdd7be4 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -1,5 +1,7 @@ $e){ + foreach( Photo::supportedTypes() as $m=>$e){ $photo = str_replace(".$e",'',$photo); } - if (substr($photo,-2,1) == '-') { + if(substr($photo,-2,1) == '-') { $resolution = intval(substr($photo,-1,1)); $photo = substr($photo,0,-2); } @@ -116,7 +119,7 @@ function photo_init(App $a) { intval($resolution) ); - $public = (dbm::is_result($r)) AND ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid'] == '') AND ($r[0]['deny_gid'] == ''); + $public = (dbm::is_result($r)) && ($r[0]['allow_cid'] == '') && ($r[0]['allow_gid'] == '') && ($r[0]['deny_cid'] == '') && ($r[0]['deny_gid'] == ''); if (dbm::is_result($r)) { $resolution = $r[0]['scale']; @@ -133,8 +136,8 @@ function photo_init(App $a) { } } - if (! isset($data)) { - if (isset($resolution)) { + if(! isset($data)) { + if(isset($resolution)) { switch($resolution) { case 4: @@ -160,8 +163,8 @@ function photo_init(App $a) { // Resize only if its not a GIF if ($mime != "image/gif") { $ph = new Photo($data, $mimetype); - if ($ph->is_valid()) { - if (isset($customres) && $customres > 0 && $customres < 500) { + if($ph->is_valid()) { + if(isset($customres) && $customres > 0 && $customres < 500) { $ph->scaleImageSquare($customres); } $data = $ph->imageString(); @@ -169,14 +172,14 @@ function photo_init(App $a) { } } - if (function_exists('header_remove')) { + if(function_exists('header_remove')) { header_remove('Pragma'); header_remove('pragma'); } header("Content-type: ".$mimetype); - if ($prvcachecontrol) { + if($prvcachecontrol) { // it is a private photo that they have no permission to view. // tell the browser not to cache it, in case they authenticate