From ed418551cdb76a72c1323fd32cb3ef6f58e697d5 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 21 Jul 2014 11:09:21 +0200 Subject: Better x and y validation, report 400 on errors Report 400 Bad Request on query errors instead of reporting 200 OK (which can be cached). Add some additional validation for the 'x' and 'y' parameters, to catch underflow (test with `x=-10` for example). Also fix a typo in the error message and include more details (the actual error). --- inc/functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/functions.inc.php b/inc/functions.inc.php index c32b3ef..3664d78 100644 --- a/inc/functions.inc.php +++ b/inc/functions.inc.php @@ -55,7 +55,7 @@ function crc32hex($str) { } function error_image() { - header("Content-Type: image/png"); + header("Content-Type: image/png", true, 400); readfile('layout/error.png'); exit; } -- cgit v1.1