remove each() keyword as it is deprecated as of php-7.2, fixes #479

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2017-10-31 13:03:06 +01:00
parent 15b62aae04
commit 421c29c491
10 changed files with 23 additions and 26 deletions

View File

@@ -20,27 +20,22 @@
/**
* Returns Array, whose elements have been checked whether thay are empty or not
*
* @param array The array to trim
* @param array $source
* The array to trim
* @return array The trim'med array
* @author Florian Lippert <flo@syscp.org>
*/
function array_trim($source)
{
$returnval = array();
if(is_array($source))
{
while(list($var, $val) = each($source))
{
if($val != ' '
&& $val != '')$returnval[$var] = $val;
if (is_array($source)) {
foreach ($source as $var => $val) {
if ($val != ' ' && $val != '') {
$returnval[$var] = $val;
}
}
}
else
{
} else {
$returnval = $source;
}
return $returnval;
}

View File

@@ -156,7 +156,8 @@ if (version_compare(PHP_VERSION, "5.4.0", "<")) {
if (get_magic_quotes_gpc()) {
$in = array(&$_GET, &$_POST, &$_COOKIE);
while (list($k, $v) = each($in)) {
$_in = $in;
foreach ($in as $k => $v) {
foreach ($v as $key => $val) {
if (!is_array($val)) {
$in[$k][$key] = stripslashes($val);