noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 150/219: HttpInput: Exception if the type is


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 150/219: HttpInput: Exception if the type is not known
Date: Mon, 18 Dec 2017 13:22:54 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 2bb31c71804a5849c6a481753d878960ff989a86
Author: Dany De Bontridder <address@hidden>
Date:   Wed Nov 15 19:57:37 2017 +0100

    HttpInput: Exception if the type is not known
---
 include/lib/http_input.class.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php
index f286d8d..d486cd6 100644
--- a/include/lib/http_input.class.php
+++ b/include/lib/http_input.class.php
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]