[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 152/219: HttpInput: Exception if the type is
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 152/219: HttpInput: Exception if the type is not known, |
Date: |
Mon, 18 Dec 2017 13:22:55 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 944a83e3bbc920b1c2ab1e03d7eda17431b2a55d
Author: Dany De Bontridder <address@hidden>
Date: Wed Nov 15 20:35:38 2017 +0100
HttpInput: Exception if the type is not known,
---
include/lib/http_input.class.php | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php
index d486cd6..bdaf97a 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);
}
+ $this->array[$p_name]=h($this->array[$p_name]);
}
- else if ($p_type=="array"&&!is_array($this->array[$p_name]))
+ else if ($p_type=="array")
{
- $this->array[$p_name]=h($this->array[$p_name]);
- throw new Exception(_("Type invalide")."[ $p_name ] =
{$this->array[$p_name]}"
+ 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"));
}
- [Noalyss-commit] [noalyss] 70/219: Task #0001475: VEN / ACH opération prédéfinie , il manque le bouton "Fermer", (continued)
- [Noalyss-commit] [noalyss] 70/219: Task #0001475: VEN / ACH opération prédéfinie , il manque le bouton "Fermer", Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 131/219: Bug : correct catch clause , getMessage is wrong must be replaced by message, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 203/219: Task #0001507: Click sur détail opérations apparaît trop haut Fixed for IE8 : use documentElement.scrollTop, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 191/219: Database : improve message when exec_sql failed, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 185/219: Fix problem with invalid unicode sequence, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 178/219: NEW : add iselect , display a list with options, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 200/219: Task #0001507: Click sur détail opérations apparaît trop haut Use the function window.pageYOffset instead of window.scrollY, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 123/219: Anc ODS : check date is valid and comment not empty, remove debug, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 52/219: task #0001372: Backup - nom du fichier Bug modele.inc.php, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 55/219: Task #1469 Code Cleaning: remove Anc_Account Use a CSS with 2 fonts , one for the title and clickable item, and a normal one. Correct Anc_Account_Table::check duplicate for update and insert, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 152/219: HttpInput: Exception if the type is not known,,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 05/219: remove warning, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 13/219: Move Noalyss_SQL.class.php do the lib folder, Dany De Bontridder, 2017/12/18