From c967e585b5597dcb2abf9e6a971c4cef07d506ad Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 6 Aug 2021 08:11:06 +0200 Subject: [PATCH] avoid duplicate entries in mysql-access-host setting Signed-off-by: Michael Kaufmann --- lib/Froxlor/Validate/Check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Froxlor/Validate/Check.php b/lib/Froxlor/Validate/Check.php index d5c1400f..01d627c4 100644 --- a/lib/Froxlor/Validate/Check.php +++ b/lib/Froxlor/Validate/Check.php @@ -74,7 +74,7 @@ class Check public static function checkMysqlAccessHost($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) { - $mysql_access_host_array = array_map('trim', explode(',', $newfieldvalue)); + $mysql_access_host_array = array_unique(array_map('trim', explode(',', $newfieldvalue))); foreach ($mysql_access_host_array as $host_entry) { if (Validate::validate_ip2($host_entry, true, 'invalidip', true, true, true, true, false) == false && Validate::validateDomain($host_entry) == false && Validate::validateLocalHostname($host_entry) == false && $host_entry != '%') {