avoid duplicate entries in mysql-access-host setting
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -74,7 +74,7 @@ class Check
|
|||||||
|
|
||||||
public static function checkMysqlAccessHost($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
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) {
|
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 != '%') {
|
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 != '%') {
|
||||||
|
|||||||
Reference in New Issue
Block a user