From 1a515b1dbf2e31ac5899e829991855f2d218bf3b Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 20 Jul 2014 23:48:36 +0200 Subject: Display a HTTP error if the command failed ... for instance, when using an overly large "s" parameter. --- type/Base.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'type/Base.class.php') diff --git a/type/Base.class.php b/type/Base.class.php index 72ce437..c3741bd 100644 --- a/type/Base.class.php +++ b/type/Base.class.php @@ -251,7 +251,10 @@ class Type_Base { $shellcmd ); $shellcmd = implode(' ', $shellcmd); - passthru($shellcmd); + passthru($shellcmd, $exitcode); + if ($exitcode !== 0) { + header('HTTP/1.1 500 Internal Server Error'); + } break; } } -- cgit v1.1