From 341d2b14f712d8d687c56dd145383831f093c490 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 1 Oct 2009 14:41:57 +0000
Subject: [PATCH] Fixed: FS#913 - Adding a new database user and table through
 the webgui and leaving the allowed IP fields empty for

---
 server/plugins-available/mysql_clientdb_plugin.inc.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php
index 493d80fb6e..a1bb4fa960 100644
--- a/server/plugins-available/mysql_clientdb_plugin.inc.php
+++ b/server/plugins-available/mysql_clientdb_plugin.inc.php
@@ -85,7 +85,9 @@ class mysql_clientdb_plugin {
           
           // check if entry is valid ip address
           $valid = true;
-          if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $db_host)) {
+		  if($db_host == "%") {
+		  	$valid = true;
+		  } elseif(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $db_host)) {
               $groups = explode(".", $db_host);
               foreach($groups as $group){
                 if($group<0 OR $group>255)
-- 
GitLab