From 22e3ec2fd06609d7dd0c697cfdd06f6c730e4dcc Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Tue, 6 Dec 2022 12:18:13 +0100 Subject: [PATCH] Fixed bug #3 which caused xss_clean() to fail when calling input variables from arrays. Closes #3. --- composer.json | 2 +- src/FuzeWorks/Security.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index e28b081..b75a8ff 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": ">=7.4.0", + "php": ">=8.1.0", "fuzeworks/core": "~1.3.0", "fuzeworks/mvcr": "~1.3.0", "fuzeworks/objectstorage": "~1.3.0" diff --git a/src/FuzeWorks/Security.php b/src/FuzeWorks/Security.php index ab6174c..2fd32d1 100644 --- a/src/FuzeWorks/Security.php +++ b/src/FuzeWorks/Security.php @@ -375,10 +375,8 @@ class Security { // Is the string an array? if (is_array($str)) { - while (list($key) = each($str)) - { - $str[$key] = $this->xss_clean($str[$key]); - } + foreach ($str as $key => $value) + $str[$key] = $this->xss_clean($value); return $str; }