X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnotice.php;h=95d16f2dd2ca495c341466d672743d7cda436429;hb=a86ffd878dc3ca8638345781bda0f18071d439e5;hp=71c4977be9bf378dff0ad65aeb076d360e9223b7;hpb=6b6e3e264f55705d47f20cf32213d8d0f0d24efc;p=friendica.git diff --git a/mod/notice.php b/mod/notice.php index 71c4977be9..95d16f2dd2 100644 --- a/mod/notice.php +++ b/mod/notice.php @@ -1,20 +1,23 @@ friendica items permanent-url compatibility */ - - function notice_init(&$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)){ - $nick = $r[0]['nickname']; - $url = App::get_baseurl()."/display/$nick/$id"; - goaway($url); - } else { - $a->error = 404; - notice( t('Item not found.') . EOL); - } - return; +/* GNU Social -> friendica items permanent-url compatibility */ +use Friendica\App; +use Friendica\Core\System; +use Friendica\Database\DBM; + +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)) { + $nick = $r[0]['nickname']; + $url = System::baseUrl() . "/display/$nick/$id"; + goaway($url); + } else { + $a->error = 404; + notice(t('Item not found.') . EOL); } + + return; +}