From 97ede7f03b7160b42eda37beedbd5da980b40a7d Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 23 Mar 2015 15:01:21 +0000 Subject: [PATCH] dblayer : don't allow anything than strings. Null parameters are skipped git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2059 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayer.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dblayer.php b/dblayer.php index 0b50512..6a33624 100644 --- a/dblayer.php +++ b/dblayer.php @@ -274,8 +274,14 @@ class dblayer extends PDO //." ". dgettext("domframework","in")." ".$key); continue; } + // Check for type inconsistencies if the value is provided - if (! is_string ($datas[$key])) + if (is_null ($datas[$key])) + { + // Skipped the removed autoincrement keys + continue; + } + elseif (! is_string ($datas[$key])) { $errors[$key] = array ("error", sprintf ( dgettext("domframework", @@ -449,7 +455,6 @@ class dblayer extends PDO } } -$this->debug = 1; // Check if the foreign keys constrains are valid before doing the insertion foreach ($this->foreign as $foreign=>$data) {