]> git.mxchange.org Git - friendica.git/blobdiff - mod/notice.php
Replace System::httpExit() by HTTPException throwing
[friendica.git] / mod / notice.php
index c2d85db166bcc7145dc1f25d765b8b25a3471b4d..b0a6a543912d71e656ed0b403695a293b4654fa7 100644 (file)
@@ -6,20 +6,17 @@
 
 use Friendica\App;
 use Friendica\Core\L10n;
-use Friendica\Core\System;
-use Friendica\Database\DBM;
+use Friendica\Database\DBA;
 
 function notice_init(App $a)
 {
        $id = $a->argv[1];
        $r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
-       if (DBM::is_result($r)) {
+       if (DBA::isResult($r)) {
                $nick = $r[0]['nickname'];
-               $url = System::baseUrl() . "/display/$nick/$id";
-               goaway($url);
+               $a->internalRedirect('display/' . $nick . '/' . $id);
        } else {
-               $a->error = 404;
-               notice(L10n::t('Item not found.') . EOL);
+               throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('Item not found.'));
        }
 
        return;