Remove/replace killme() with *exit()

This commit is contained in:
Hypolite Petovan 2018-12-26 00:40:12 -05:00
parent df386800d3
commit 895b3abf32
75 changed files with 167 additions and 187 deletions

View file

@ -39,7 +39,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if (!DBA::isResult($r)) {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
killme();
exit();
}
return;
}
@ -55,7 +55,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
killme();
exit();
}
return;
}
@ -104,17 +104,17 @@ function wall_upload_post(App $a, $desktopmode = true)
if (!$can_post) {
if ($r_json) {
echo json_encode(['error' => L10n::t('Permission denied.')]);
killme();
exit();
}
notice(L10n::t('Permission denied.') . EOL);
killme();
exit();
}
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
}
killme();
exit();
}
$src = '';
@ -164,10 +164,10 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($src == "") {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
killme();
exit();
}
notice(L10n::t('Invalid request.').EOL);
killme();
exit();
}
// This is a special treatment for picture upload from Twidere
@ -201,7 +201,7 @@ function wall_upload_post(App $a, $desktopmode = true)
echo $msg. EOL;
}
@unlink($src);
killme();
exit();
}
$imagedata = @file_get_contents($src);
@ -215,7 +215,7 @@ function wall_upload_post(App $a, $desktopmode = true)
echo $msg. EOL;
}
@unlink($src);
killme();
exit();
}
$Image->orient($src);
@ -253,7 +253,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else {
echo $msg. EOL;
}
killme();
exit();
}
if ($width > 640 || $height > 640) {
@ -283,7 +283,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if (!$r) {
if ($r_json) {
echo json_encode(['error' => '']);
killme();
exit();
}
return false;
}
@ -300,7 +300,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) {
echo json_encode(['picture' => $picture]);
killme();
exit();
}
Logger::log("upload done", Logger::DEBUG);
return $picture;
@ -310,10 +310,10 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) {
echo json_encode(['ok' => true]);
killme();
exit();
}
echo "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n";
killme();
exit();
// NOTREACHED
}