Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
ab9dd2be
Commit
ab9dd2be
authored
11 years ago
by
Florian Gnaegi - frentix GmbH
Browse files
Options
Downloads
Patches
Plain Diff
OO-1003 fix issue with trailing white space when setting email via RESt
parent
ad4f788c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/user/propertyhandlers/EmailProperty.java
+4
-2
4 additions, 2 deletions
...in/java/org/olat/user/propertyhandlers/EmailProperty.java
with
4 additions
and
2 deletions
src/main/java/org/olat/user/propertyhandlers/EmailProperty.java
+
4
−
2
View file @
ab9dd2be
...
@@ -59,9 +59,9 @@ public class EmailProperty extends Generic127CharTextPropertyHandler {
...
@@ -59,9 +59,9 @@ public class EmailProperty extends Generic127CharTextPropertyHandler {
@Override
@Override
protected
void
setInternalValue
(
User
user
,
String
mail
)
{
protected
void
setInternalValue
(
User
user
,
String
mail
)
{
// save mail addresses always lowercase
// save mail addresses always lower
case
and remove trailing whitespace
if
(
mail
!=
null
)
{
if
(
mail
!=
null
)
{
super
.
setInternalValue
(
user
,
mail
.
toLowerCase
());
super
.
setInternalValue
(
user
,
mail
.
toLowerCase
()
.
trim
()
);
}
else
{
}
else
{
super
.
setInternalValue
(
user
,
null
);
super
.
setInternalValue
(
user
,
null
);
}
}
...
@@ -132,6 +132,7 @@ public class EmailProperty extends Generic127CharTextPropertyHandler {
...
@@ -132,6 +132,7 @@ public class EmailProperty extends Generic127CharTextPropertyHandler {
String
value
=
textElement
.
getValue
();
String
value
=
textElement
.
getValue
();
if
(
StringHelper
.
containsNonWhitespace
(
value
))
{
if
(
StringHelper
.
containsNonWhitespace
(
value
))
{
value
=
value
.
toLowerCase
().
trim
();
// check mail address syntax
// check mail address syntax
if
(!
MailHelper
.
isValidEmailAddress
(
value
))
{
if
(!
MailHelper
.
isValidEmailAddress
(
value
))
{
textElement
.
setErrorKey
(
i18nFormElementLabelKey
()
+
".error.valid"
,
null
);
textElement
.
setErrorKey
(
i18nFormElementLabelKey
()
+
".error.valid"
,
null
);
...
@@ -159,6 +160,7 @@ public class EmailProperty extends Generic127CharTextPropertyHandler {
...
@@ -159,6 +160,7 @@ public class EmailProperty extends Generic127CharTextPropertyHandler {
}
}
if
(
StringHelper
.
containsNonWhitespace
(
value
))
{
if
(
StringHelper
.
containsNonWhitespace
(
value
))
{
value
=
value
.
toLowerCase
().
trim
();
// check mail address syntax
// check mail address syntax
if
(
!
MailHelper
.
isValidEmailAddress
(
value
))
{
if
(
!
MailHelper
.
isValidEmailAddress
(
value
))
{
validationError
.
setErrorKey
(
i18nFormElementLabelKey
()
+
".error.valid"
);
validationError
.
setErrorKey
(
i18nFormElementLabelKey
()
+
".error.valid"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment