From 09b790e9c59c496ec1aa537ff7bfa21ca0f4b5cd Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Mon, 15 Feb 2016 03:38:06 -0500
Subject: [PATCH] Merge branch 'master' into 'stable-3.1'

---
 server/plugins-available/mysql_clientdb_plugin.inc.php |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php
index 2f2171f..743d27a 100644
--- a/server/plugins-available/mysql_clientdb_plugin.inc.php
+++ b/server/plugins-available/mysql_clientdb_plugin.inc.php
@@ -101,7 +101,8 @@
 			$valid = true;
 			if($db_host == '%' || $db_host == 'localhost') {
 				$valid = true;
-			} elseif(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $db_host)) {
+//			} elseif(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $db_host)) {
+			} elseif(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $db_host)) {
 				$groups = explode('.', $db_host);
 				foreach($groups as $group){
 					if($group<0 or $group>255)
@@ -227,7 +228,6 @@
 
 			}
 
-			$link->query('FLUSH PRIVILEGES;');
 			$link->close();
 		}
 	}
@@ -432,7 +432,6 @@
 						}
 					}
 					// Database is not active, so stop processing here
-					$link->query('FLUSH PRIVILEGES;');
 					$link->close();
 					return;
 				}
@@ -569,8 +568,6 @@
 				}
 			}
 
-
-			$link->query('FLUSH PRIVILEGES;');
 			$link->close();
 		}
 
@@ -620,7 +617,6 @@
 				$app->log('Error while dropping MySQL database: '.$data['old']['database_name'].' '.$link->error, LOGLEVEL_WARNING);
 			}
 
-			$link->query('FLUSH PRIVILEGES;');
 			$link->close();
 		}
 
@@ -684,7 +680,6 @@
 			}
 		}
 
-		$link->query('FLUSH PRIVILEGES;');
 		$link->close();
 
 	}
@@ -720,7 +715,6 @@
 			}
 		}
 
-		$link->query('FLUSH PRIVILEGES;');
 		$link->close();
 	}
 

--
Gitblit v1.9.1