X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffbrowser.php;h=2f1181a8564b4a250700f28079e94a582d7e4110;hb=7e06127d74565b1c63ca897437ef084a0a7415e0;hp=b9f9b4c7f6a3e4b6c399fffa095a9658fbb92337;hpb=13827edd2cb6632a13ca983fe8c47cf679eaf4dc;p=friendica.git diff --git a/mod/fbrowser.php b/mod/fbrowser.php index b9f9b4c7f6..2f1181a856 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -1,5 +1,22 @@ . + * * @package Friendica\modules * @subpackage FileBrowser * @author Fabio Comuni @@ -7,6 +24,7 @@ use Friendica\App; use Friendica\Core\Renderer; +use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Photo; @@ -21,15 +39,15 @@ use Friendica\Util\Strings; function fbrowser_content(App $a) { if (!local_user()) { - exit(); + System::exit(); } if (DI::args()->getArgc() == 1) { - exit(); + System::exit(); } // Needed to match the correct template in a module that uses a different theme than the user/site/default - $theme = Strings::sanitizeFilePathItem($_GET['theme'] ?? null); + $theme = Strings::sanitizeFilePathItem($_GET['theme'] ?? ''); if ($theme && is_file("view/theme/$theme/config.php")) { $a->setCurrentTheme($theme); } @@ -85,7 +103,8 @@ function fbrowser_content(App $a) return [ DI::baseUrl() . '/photos/' . $a->getLoggedInUserNickname() . '/image/' . $rr['resource-id'], $filename_e, - DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext + DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext, + $rr['desc'] ]; } $files = array_map("_map_files1", $r); @@ -121,7 +140,7 @@ function fbrowser_content(App $a) $tpl = Renderer::getMarkupTemplate($template_file); $o = Renderer::replaceMacros($tpl, [ '$type' => 'file', - '$path' => [ [ "", DI::l10n()->t("Files")] ], + '$path' => ['' => DI::l10n()->t('Files')], '$folders' => false, '$files' => $files, '$cancel' => DI::l10n()->t('Cancel'), @@ -136,7 +155,6 @@ function fbrowser_content(App $a) if (!empty($_GET['mode'])) { return $o; } else { - echo $o; - exit(); + System::httpExit($o); } }