Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
email
Commits
6dcdbfb4
Commit
6dcdbfb4
authored
Apr 15, 2008
by
Matthias Hutterer
Browse files
fixes #173096 : added a trim to remove possible whitespaces when validating
parent
54d904c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
email.module
email.module
+4
-4
No files found.
email.module
View file @
6dcdbfb4
...
...
@@ -202,11 +202,11 @@ function email_widget($op, &$node, $field, &$node_field) {
case
'validate'
:
if
(
is_array
(
$node_field
))
{
foreach
(
$node_field
as
$delta
=>
$item
)
{
if
(
$item
[
'email'
]
!=
''
&&
!
valid_email_address
(
$item
[
'email'
]))
{
form_set_error
(
$field
[
'field_name'
],
t
(
'"%mail" is not a valid email address'
,
array
(
'%mail'
=>
$item
[
'email'
])));
}
foreach
(
$node_field
as
$delta
=>
$item
)
{
if
(
$item
[
'email'
]
!=
''
&&
!
valid_email_address
(
trim
(
$item
[
'email'
])))
{
form_set_error
(
$field
[
'field_name'
],
t
(
'"%mail" is not a valid email address'
,
array
(
'%mail'
=>
$item
[
'email'
])));
}
}
}
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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