1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-04 18:06:58 +02:00

Fix array handling in toDB() and improved performance for simple integers.

This commit is contained in:
Cameron 2019-03-02 10:07:07 -08:00
parent 943ea1ddd7
commit 7aaf09a6d2

View File

@ -502,7 +502,8 @@ class e_parse extends e_parser
foreach ($data as $key => $var)
{
//Fix - sanitize keys as well
$ret[$this->toDB($key, $nostrip, $no_encode, $mod, $parm)] = $this->toDB($var, $nostrip, $no_encode, $mod, $parm);
$key = filter_var($key,FILTER_SANITIZE_STRING);
$ret[$key] = $this->toDB($var, $nostrip, $no_encode, $mod, $parm);
}
return $ret;
@ -515,6 +516,11 @@ class e_parse extends e_parser
$data = stripslashes($data);
}
if(intval($data) === $data) // simple integer.
{
return $data;
}
if ($mod !== 'pReFs') //XXX We're not saving prefs.
{