X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffbrowser.php;h=559896acb13932ea6c690b4dd93d6dca0a385ef2;hb=a876c208504af3ee801689886ec8cab8f3eeff00;hp=cc51d41995301def0f1fe7f7a43ed910da538aa2;hpb=bd972151478f40f73585519110700222a1931d44;p=friendica.git diff --git a/mod/fbrowser.php b/mod/fbrowser.php index cc51d41995..559896acb1 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -14,22 +14,22 @@ use Friendica\Object\Image; /** * @param App $a + * @return string + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ function fbrowser_content(App $a) { if (!local_user()) { - killme(); + exit(); } if ($a->argc == 1) { - killme(); + exit(); } $template_file = "filebrowser.tpl"; - $mode = ""; - if (x($_GET, 'mode')) { - $mode = "?mode=".$_GET['mode']; - } + + $o = ''; switch ($a->argv[1]) { case "image": @@ -53,12 +53,11 @@ function fbrowser_content(App $a) $albums = array_map("_map_folder1", $albums); } - $album = ""; - if ($a->argc==3) { + if ($a->argc == 3) { $album = hex2bin($a->argv[2]); $sql_extra = sprintf("AND `album` = '%s' ", DBA::escape($album)); $sql_extra2 = ""; - $path[]=[$a->argv[2], $album]; + $path[] = [$a->argv[2], $album]; } $r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`, @@ -72,7 +71,7 @@ function fbrowser_content(App $a) function _map_files1($rr) { - $a = get_app(); + $a = \get_app(); $types = Image::supportedTypes(); $ext = $types[$rr['type']]; $filename_e = $rr['filename']; @@ -116,8 +115,7 @@ function fbrowser_content(App $a) function _map_files2($rr) { - $a = get_app(); - list($m1,$m2) = explode("/", $rr['filetype']); + list($m1, $m2) = explode("/", $rr['filetype']); $filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip"); $filename_e = $rr['filename']; @@ -142,10 +140,10 @@ function fbrowser_content(App $a) break; } - if (x($_GET, 'mode')) { + if (!empty($_GET['mode'])) { return $o; } else { echo $o; - killme(); + exit(); } }