noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 69/219: HttpInput : do not use in_array but a


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 69/219: HttpInput : do not use in_array but array_key_exists,
Date: Mon, 18 Dec 2017 13:22:40 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 17b8a0504bca7656fa9f3bee091d64331f292642
Author: Dany De Bontridder <address@hidden>
Date:   Fri Oct 6 10:00:49 2017 +0200

    HttpInput : do not use in_array but array_key_exists,
---
 include/lib/http_input.class.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php
index 4b4146f..f2b71b6 100644
--- a/include/lib/http_input.class.php
+++ b/include/lib/http_input.class.php
@@ -86,7 +86,7 @@ class HttpInput
         {
             if (func_num_args()==3)
             {
-                if (in_array($p_name,$this->array) )
+                if (array_key_exists($p_name,$this->array) )
                 {
                     $this->check_type($p_name, $p_type);
                     return $this->array[$p_name];
@@ -96,7 +96,7 @@ class HttpInput
                     return $p_default;
                 }
             }
-            if (!in_array($p_name,$this->array))
+            if (!array_key_exists($p_name,$this->array))
             {
                 throw new Exception(_('Paramètre invalide')."[$p_name]",
                 EXC_PARAM_VALUE);



reply via email to

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