Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chauvet Nicolas
lemonldap-ng
Commits
55aaed7a
Commit
55aaed7a
authored
Dec 15, 2017
by
Xavier Guimard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UTF-8 problems in mail
Fixes: #1338
parent
3273e9db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm
...dap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm
+2
-2
lemonldap-ng-portal/t/42-Register-Demo.t
lemonldap-ng-portal/t/42-Register-Demo.t
+6
-4
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm
View file @
55aaed7a
...
...
@@ -307,7 +307,7 @@ sub _register {
$body
=~
s/\$expMailDate/$req->datas->{expMailDate}/g
;
$body
=~
s/\$expMailTime/$req->datas->{expMailTime}/g
;
$body
=~
s/\$url/$url/g
;
$body
=~
s/\$(\w+)/
decode("utf8",$req->datas->{registerInfo}->{$1})/g
e
;
$body
=~
s/\$(\w+)/
$req->datas->{registerInfo}->{$1}/
eg
;
# Send mail
return
PE_MAILERROR
...
...
@@ -358,7 +358,7 @@ sub _register {
$body
=
$self
->
loadTemplate
(
'
mail_register_done
',
filter
=>
$tr
);
# Replace variables in body
$body
=~
s/\$(\w+)/
decode("utf8",$req->datas->{registerInfo}->{$1})
/g
e
;
$body
=~
s/\$(\w+)/
$req->datas->{registerInfo}->{$1}
/g
e
;
# Send mail
return
PE_MAILERROR
...
...
lemonldap-ng-portal/t/42-Register-Demo.t
View file @
55aaed7a
...
...
@@ -9,7 +9,7 @@ BEGIN {
};
}
my
$maintests
=
8
;
my
$maintests
=
9
;
my
(
$res
,
$user
,
$pwd
);
SKIP:
{
...
...
@@ -45,18 +45,20 @@ SKIP: {
$res
=
$client
->
_post
(
'
/register
',
IO::
String
->
new
(
'
firstname=f
o
o&lastname=bar&mail=foobar%40badwolf.org
'),
length
=>
5
2
,
'
firstname=f
ô
o&lastname=bar&mail=foobar%40badwolf.org
'),
length
=>
5
3
,
accept
=>
'
text/html
'
),
'
Ask to create account
'
);
expectOK
(
$res
);
ok
(
mail
()
=~
m#a href="http://auth.example.com/register\?(.*?)"#
,
my
$mail
=
mail
();
ok
(
$mail
=~
m#a href="http://auth.example.com/register\?(.*?)"#
,
'
Found register token
'
);
$query
=
$1
;
ok
(
$query
=~
/register_token=/
,
'
Found register_token
'
);
ok
(
$mail
=~
/fôo/
,
'
UTF-8 works
'
)
or
explain
(
$mail
,
'
fôo
'
);
ok
(
$res
=
...
...
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