diff --git a/html/includes/vars.inc.php b/html/includes/vars.inc.php
index c9008d217..3326a119f 100644
--- a/html/includes/vars.inc.php
+++ b/html/includes/vars.inc.php
@@ -45,3 +45,4 @@ foreach ($_POST as $name => $value) {
}
array_walk_recursive($vars,'sanitize_array');
+reset($vars);
diff --git a/includes/dbFacile.mysql.php b/includes/dbFacile.mysql.php
index d9372cbb6..b164eb1b8 100644
--- a/includes/dbFacile.mysql.php
+++ b/includes/dbFacile.mysql.php
@@ -267,6 +267,7 @@ function dbFetchRows($sql, $parameters=array(), $nocache=false) {
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$rows,$config['memcached']['ttl']);
}
array_walk_recursive($rows,'sanitize_array');
+ reset($rows);
return $rows;
}
@@ -335,6 +336,7 @@ function dbFetchRow($sql=null, $parameters=array(), $nocache=false) {
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$row,$config['memcached']['ttl']);
}
array_walk_recursive($row,'sanitize_array');
+ reset($row);
return $row;
}
else {
diff --git a/includes/dbFacile.mysqli.php b/includes/dbFacile.mysqli.php
index 70c4651e7..08c9a6cf5 100644
--- a/includes/dbFacile.mysqli.php
+++ b/includes/dbFacile.mysqli.php
@@ -268,6 +268,7 @@ function dbFetchRows($sql, $parameters=array(), $nocache=false) {
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$rows,$config['memcached']['ttl']);
}
array_walk_recursive($rows,'sanitize_array');
+ reset($rows);
return $rows;
}
@@ -336,6 +337,7 @@ function dbFetchRow($sql=null, $parameters=array(), $nocache=false) {
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$row,$config['memcached']['ttl']);
}
array_walk_recursive($row,'sanitize_array');
+ reset($row);
return $row;
}
else {
diff --git a/includes/object-cache.inc.php b/includes/object-cache.inc.php
index dfb81621e..56a2e04cc 100644
--- a/includes/object-cache.inc.php
+++ b/includes/object-cache.inc.php
@@ -97,6 +97,7 @@ class ObjCache implements ArrayAccess {
else {
$GLOBALS['_ObjCache'][$this->obj][$obj]['value'] = dbFetchRows($this->data[$obj]['query'], $this->data[$obj]['params']);
if (sizeof($GLOBALS['_ObjCache'][$this->obj][$obj]['value']) == 1 && sizeof($GLOBALS['_ObjCache'][$this->obj][$obj]['value'][0]) == 1) {
+ reset($GLOBALS['_ObjCache'][$this->obj][$obj]['value'][0]);
$GLOBALS['_ObjCache'][$this->obj][$obj]['value'] = current($GLOBALS['_ObjCache'][$this->obj][$obj]['value'][0]);
}
return $GLOBALS['_ObjCache'][$this->obj][$obj]['value'];