From: Mischa POSLAWSKY Date: Wed, 22 May 2019 16:42:06 +0000 (+0200) Subject: html headers before wrapper errors X-Git-Tag: v0.4~6 X-Git-Url: http://git.shiar.nl/sc2-widget/commitdiff_plain/3d1855ba5c9dc7171edf0382e0b456e49be822db html headers before wrapper errors --- diff --git a/widget.php b/widget.php index e5aa326..eec0637 100644 --- a/widget.php +++ b/widget.php @@ -1,12 +1,30 @@ '; + } + print "

$message

\n"; + print "\n\n"; + exit; +} + $request = trim($_SERVER['PATH_INFO'], '/'); if (!file_exists("$request.json")) { if (!is_numeric($request)) { - die("unknown profile request $request"); + error("Unknown profile request $request", 400); } system("./getsc2clan $request | sponge $request.json", $exitcode); if ($exitcode) { - die("no results for profile id $request from Blizzard"); + error("No results for profile id $request from Blizzard", 503); } } require('widget.html');