HttpInput: Exception if the type is not known

This commit is contained in:
Dany De Bontridder 2017-11-15 19:57:37 +01:00
parent 40b81bb7e6
commit 2bb31c7180

View file

@ -48,14 +48,14 @@ class HttpInput
if ($p_type=="string")
return;
// Check if number
if ($p_type=="number"&&isNumber($this->array[$p_name])==0 )
else if ($p_type=="number"&&isNumber($this->array[$p_name])==0 )
{
$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
if ($p_type=="date")
else if ($p_type=="date")
{
if (isDate($this->array[$p_name]) <> $this->array[$p_name])
{
@ -64,11 +64,13 @@ class HttpInput
, EXC_PARAM_TYPE);
}
}
if ($p_type=="array"&&!is_array($this->array[$p_name]))
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]}"
, EXC_PARAM_TYPE);
}else {
throw new Exception(_("Unknown type"));
}
}
catch (Exception $ex)