dblayeroo : normalize : use the trim only if not null value is provided

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4792 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2018-12-21 09:57:29 +00:00
parent 35543a727a
commit b05453d202

View File

@@ -2630,7 +2630,11 @@ class dblayeroo
{
if (! is_array ($values))
$this->DBException ("Invalid values to normalize : not an array", 406);
$values = array_map ("trim", $values);
foreach ($values as $key => $val)
{
if ($val !== null)
$values[$key] = trim ($val);
}
return $values;
}
// }}}
@@ -3192,7 +3196,7 @@ class dblayeroo
{
if (! key_exists ($this->dsn, self::$instance))
$this->DBException ("Direct query without established connection");
return self::$instance[$this->dsn]->query ($sql, PDO::FETCH_ASSOC);
return self::$instance[$this->dsn]->query ($sql, \PDO::FETCH_ASSOC);
}
/* }}} */