Commit 33f97321 authored by Till Brehm's avatar Till Brehm

Merge branch 'stable-3.1' into 'stable-3.1'

use php filter_var database remote-ip (#4215)



See merge request !453
parents 7000d9bb c9ba0767
......@@ -105,6 +105,8 @@ class mysql_clientdb_plugin {
$valid = true;
if($db_host == '%' || $db_host == 'localhost') {
$valid = true;
} elseif(function_exists('filter_var')) {
if(!filter_var($db_host, FILTER_VALIDATE_IP)) $valid=false;
} 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){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment