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

@ -25,14 +25,14 @@ class Oembed extends BaseModule
if ($a->argv[1] == 'b2h') {
$url = ["", trim(hex2bin($_REQUEST['url']))];
echo Content\OEmbed::replaceCallback($url);
killme();
exit();
}
// Unused form: /oembed/h2b?text=...
if ($a->argv[1] == 'h2b') {
$text = trim(hex2bin($_REQUEST['text']));
echo Content\OEmbed::HTML2BBCode($text);
killme();
exit();
}
if ($a->argc == 2) {
@ -49,6 +49,6 @@ class Oembed extends BaseModule
echo $j->html;
echo '</body></html>';
}
killme();
exit();
}
}

View file

@ -20,7 +20,6 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
*/
class Photo extends BaseModule
{
/**
* @brief Module initializer
*
@ -78,7 +77,7 @@ class Photo extends BaseModule
if ($photo === false) {
// not using System::httpExit() because we don't want html here.
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found" , true, 404);
killme();
exit();
}
$cacheable = ($photo["allow_cid"] . $photo["allow_gid"] . $photo["deny_cid"] . $photo["deny_gid"] === "") && (isset($photo["cacheable"]) ? $photo["cacheable"] : true);
@ -90,13 +89,11 @@ class Photo extends BaseModule
System::httpExit(500, ["description" => "Invalid photo with id {$photo["id"]}."]);
}
// if customsize is set and image is not a gif, resize it
if ($img->getType() !== "image/gif" && $customsize > 0 && $customsize < 501) {
$img->scaleToSquare($customsize);
}
if (function_exists("header_remove")) {
header_remove("Pragma");
header_remove("pragma");
@ -117,11 +114,9 @@ class Photo extends BaseModule
header("Cache-Control: max-age=31536000");
}
echo $img->asString();
killme();
exit();
}
private static function stripExtension($name)