diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php index d486cd6e3..bdaf97a77 100644 --- a/include/lib/http_input.class.php +++ b/include/lib/http_input.class.php @@ -48,27 +48,32 @@ class HttpInput if ($p_type=="string") return; // Check if number - else if ($p_type=="number"&&isNumber($this->array[$p_name])==0 ) + else if ($p_type=="number") { + if ( isNumber($this->array[$p_name])==0 ) + { + throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}" + , EXC_PARAM_TYPE); + } $this->array[$p_name]=h($this->array[$p_name]); - throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}" - , EXC_PARAM_TYPE); } // Check if date dd.mm.yyyy else if ($p_type=="date") { if (isDate($this->array[$p_name]) <> $this->array[$p_name]) { - $this->array[$p_name]=h($this->array[$p_name]); throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}" , EXC_PARAM_TYPE); } - } - else if ($p_type=="array"&&!is_array($this->array[$p_name])) - { $this->array[$p_name]=h($this->array[$p_name]); - throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}" + } + else if ($p_type=="array") + { + if (!is_array($this->array[$p_name]) ) { + throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}" , EXC_PARAM_TYPE); + } + $this->array[$p_name]=h($this->array[$p_name]); }else { throw new Exception(_("Unknown type")); }