Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Jozef Sroka
ISPConfig 3
Commits
33f97321
Commit
33f97321
authored
Sep 26, 2016
by
Till Brehm
Browse files
Merge branch 'stable-3.1' into 'stable-3.1'
use php filter_var database remote-ip (#4215) See merge request !453
parents
7000d9bb
c9ba0767
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/mysql_clientdb_plugin.inc.php
View file @
33f97321
...
...
@@ -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
){
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment