1
0
Fork 0

Using the standard function to return http errors

This commit is contained in:
Michael 2018-12-02 19:33:01 +00:00
commit 83489b36c4
2 changed files with 5 additions and 7 deletions

View file

@ -18,8 +18,7 @@ function fetch_init(App $a)
{
if (($a->argc != 3) || (!in_array($a->argv[1], ["post", "status_message", "reshare"]))) {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
System::httpExit(404, ['title' => L10n::t('Not found.')]);
}
$guid = $a->argv[2];
@ -45,15 +44,13 @@ function fetch_init(App $a)
}
}
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
System::httpExit(404, ['title' => L10n::t('Not found.')]);
}
// Fetch some data from the author (We could combine both queries - but I think this is more readable)
$user = User::getOwnerDataById($item["uid"]);
if (!$user) {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
System::httpExit(404, ['title' => L10n::t('Not found.')]);
}
$status = Diaspora::buildStatus($item, $user);