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
lolo888
ISPConfig 3
Commits
0bfbaafe
Commit
0bfbaafe
authored
Nov 25, 2013
by
Marius Cramer
Browse files
Added: new validator ISASCII to forbid non-ascii characters
parent
2ed8f05c
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/remoting_lib.inc.php
View file @
0bfbaafe
...
...
@@ -511,6 +511,15 @@ class remoting_lib {
}
}
break
;
case
'ISASCII'
:
if
(
preg_match
(
"/[^
\x20
-
\x7F
]/"
,
$field_value
))
{
$errmsg
=
$validator
[
'errmsg'
];
if
(
isset
(
$this
->
wordbook
[
$errmsg
]))
{
$this
->
errorMessage
.
=
$this
->
wordbook
[
$errmsg
]
.
"<br />
\r\n
"
;
}
else
{
$this
->
errorMessage
.
=
$errmsg
.
"<br />
\r\n
"
;
}
}
case
'ISEMAIL'
:
if
(
function_exists
(
'filter_var'
))
{
if
(
filter_var
(
$field_value
,
FILTER_VALIDATE_EMAIL
)
===
false
)
{
...
...
interface/lib/classes/tform.inc.php
View file @
0bfbaafe
...
...
@@ -845,6 +845,15 @@ class tform {
}
}
break
;
case
'ISASCII'
:
if
(
preg_match
(
"/[^
\x20
-
\x7F
]/"
,
$field_value
))
{
$errmsg
=
$validator
[
'errmsg'
];
if
(
isset
(
$this
->
wordbook
[
$errmsg
]))
{
$this
->
errorMessage
.
=
$this
->
wordbook
[
$errmsg
]
.
"<br />
\r\n
"
;
}
else
{
$this
->
errorMessage
.
=
$errmsg
.
"<br />
\r\n
"
;
}
}
case
'ISEMAIL'
:
if
(
function_exists
(
'filter_var'
))
{
if
(
filter_var
(
$field_value
,
FILTER_VALIDATE_EMAIL
)
===
false
)
{
...
...
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