aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc
diff options
context:
space:
mode:
authorPeter Wu2014-07-21 11:09:21 +0200
committerPeter Wu2014-07-21 11:09:21 +0200
commited418551cdb76a72c1323fd32cb3ef6f58e697d5 (patch)
treedba230c2b1b007dbc3fd768badad0e0a999d4b7e /inc
parentFix overly permissive hostname validation, fix host check (diff)
downloadapt-panopticon_cgp-ed418551cdb76a72c1323fd32cb3ef6f58e697d5.zip
apt-panopticon_cgp-ed418551cdb76a72c1323fd32cb3ef6f58e697d5.tar.gz
apt-panopticon_cgp-ed418551cdb76a72c1323fd32cb3ef6f58e697d5.tar.bz2
apt-panopticon_cgp-ed418551cdb76a72c1323fd32cb3ef6f58e697d5.tar.xz
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).
Diffstat (limited to 'inc')
-rw-r--r--inc/functions.inc.php2
1 files changed, 1 insertions, 1 deletions
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) {
55} 55}
56 56
57function error_image() { 57function error_image() {
58 header("Content-Type: image/png"); 58 header("Content-Type: image/png", true, 400);
59 readfile('layout/error.png'); 59 readfile('layout/error.png');
60 exit; 60 exit;
61} 61}