From 4a2f9be2be72161fdc7011410b2be25b5e58cb83 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 19 Oct 2010 22:38:33 +0200 Subject: [PATCH] added check for valid &from & &to paramters --- backend/lib/Interpreter/Interpreter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/lib/Interpreter/Interpreter.php b/backend/lib/Interpreter/Interpreter.php index 51557de..a6c3671 100644 --- a/backend/lib/Interpreter/Interpreter.php +++ b/backend/lib/Interpreter/Interpreter.php @@ -59,6 +59,9 @@ abstract class Interpreter implements InterpreterInterface { $this->from = (isset($from)) ? self::parseDateTimeString($from, time() * 1000) : NULL; $this->to = (isset($to)) ? self::parseDateTimeString($to, (isset($this->from)) ? $this->from : time() * 1000) : NULL; + if (!is_null($this->from) && !is_null($this->from) && $this->from > $this->to) { + throw new \Exception('&from is larger than &to parameter'); + } } /**