Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
99c8a21f
Commit
99c8a21f
authored
Dec 20, 2008
by
fantu
Browse files
improve of ip validator
parent
0b6b1e4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/tform.inc.php
View file @
99c8a21f
...
...
@@ -632,7 +632,15 @@ class tform {
}
break
;
case
'ISIPV4'
:
if
(
!
preg_match
(
"/^[0-9]
{
1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3
}
$/"
,
$field_value
))
{
$vip
=
1
;
if
(
preg_match
(
"/^[0-9]
{
1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3
}
$/"
,
$field_value
)){
$groups
=
explode
(
"."
,
$field_value
);
foreach
(
$groups
as
$group
){
if
(
$group
<
0
OR
$group
>
255
)
$vip
=
0
;
}
}
else
{
$vip
=
0
;}
if
(
$vip
==
0
)
{
$errmsg
=
$validator
[
'errmsg'
];
if
(
isset
(
$this
->
wordbook
[
$errmsg
]))
{
$this
->
errorMessage
.
=
$this
->
wordbook
[
$errmsg
]
.
"<br />
\r\n
"
;
...
...
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