mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Fix array handling in toDB() and improved performance for simple integers.
This commit is contained in:
@@ -502,7 +502,8 @@ class e_parse extends e_parser
|
|||||||
foreach ($data as $key => $var)
|
foreach ($data as $key => $var)
|
||||||
{
|
{
|
||||||
//Fix - sanitize keys as well
|
//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;
|
return $ret;
|
||||||
@@ -515,6 +516,11 @@ class e_parse extends e_parser
|
|||||||
$data = stripslashes($data);
|
$data = stripslashes($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(intval($data) === $data) // simple integer.
|
||||||
|
{
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
if ($mod !== 'pReFs') //XXX We're not saving prefs.
|
if ($mod !== 'pReFs') //XXX We're not saving prefs.
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user