X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fviewsrc.php;h=55eb0b990c06ca5f2e44978b1e01450162f86fd9;hb=708ffaff51d3f5112af6b1fbd25d7ff6391e496e;hp=2b91d6fc42b95da9c201b06ebb9becebf67afea9;hpb=0ec44f3e8a73229c3aadea86f61b5571a701c6b7;p=friendica.git
diff --git a/mod/viewsrc.php b/mod/viewsrc.php
index 2b91d6fc42..55eb0b990c 100644
--- a/mod/viewsrc.php
+++ b/mod/viewsrc.php
@@ -18,17 +18,15 @@ function viewsrc_content(App $a)
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if (!$item_id) {
- $a->error = 404;
- notice(L10n::t('Item not found.') . EOL);
- return;
+ throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('Item not found.'));
}
$item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $item_id]);
- if (DBA::is_result($item)) {
- if (is_ajax()) {
+ if (DBA::isResult($item)) {
+ if ($a->isAjax()) {
echo str_replace("\n", '
', $item['body']);
- killme();
+ exit();
} else {
$o .= str_replace("\n", '
', $item['body']);
}