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
This commit is contained in:
2015-03-23 15:01:21 +00:00
parent aa72825d21
commit 97ede7f03b

View File

@@ -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)
{