mirror of
https://github.com/e107inc/e107.git
synced 2025-06-04 09:54:56 +02:00
Fix array handling in toDB() and improved performance for simple integers.
This commit is contained in:
parent
943ea1ddd7
commit
7aaf09a6d2
@ -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.
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -550,7 +556,7 @@ class e_parse extends e_parser
|
|||||||
{
|
{
|
||||||
$no_encode = true;
|
$no_encode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($parm !== null && is_numeric($parm) && !check_class($core_pref->get('post_html'), '', $parm))
|
if($parm !== null && is_numeric($parm) && !check_class($core_pref->get('post_html'), '', $parm))
|
||||||
{
|
{
|
||||||
$no_encode = false;
|
$no_encode = false;
|
||||||
@ -571,8 +577,8 @@ class e_parse extends e_parser
|
|||||||
|
|
||||||
$ret = preg_replace("/&#(\d*?);/", "&#\\1;", $data);
|
$ret = preg_replace("/&#(\d*?);/", "&#\\1;", $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX - php_bbcode has been deprecated.
|
// XXX - php_bbcode has been deprecated.
|
||||||
if ((strpos($mod, 'no_php') !== false) || !check_class($core_pref->get('php_bbcode')))
|
if ((strpos($mod, 'no_php') !== false) || !check_class($core_pref->get('php_bbcode')))
|
||||||
{
|
{
|
||||||
$ret = preg_replace("#\[(php)#i", "[\\1", $ret);
|
$ret = preg_replace("#\[(php)#i", "[\\1", $ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user