Bugzilla – Attachment 12996 Details for
Bug 8953
opac-userupdate encoding issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8953 - opac-userupdate encoding issues
Bug-8953---opac-userupdate-encoding-issues.patch (text/plain), 2.21 KB, created by
Mirko Tietgen
on 2012-10-22 13:25:26 UTC
(
hide
)
Description:
Bug 8953 - opac-userupdate encoding issues
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2012-10-22 13:25:26 UTC
Size:
2.21 KB
patch
obsolete
>From be793ffa376d425c46dfaea1c53e3c82455125ac Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Mon, 22 Oct 2012 14:13:12 +0200 >Subject: [PATCH] Bug 8953 - opac-userupdate encoding issues > >This script has various encoding problems: > >1. parametars from CGI are not encoded in utf-8, so when they are > compared with utf-8 strings from database every field with > utf-8 characters will be reported in e-mail as changed >2. when sending e-mail, wide characters are passed to Mail::Sendmail > which results in software error if edited field has utf-8 characters > (because of first point, this happend if ANY fields has utf-8 chars) >3. when declaring encoding for outgoing e-mail utf-8 is more correct > than just utf8 > >Test scenario: > >1. open opac-userupdate and edit user which has utf-8 characters in > at least one field (firstname and surname are common examples) >2. edit one of other fields and add utf-8 character to it >3. verify that e-mail with changes arrived with just edited field > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >--- > opac/opac-userupdate.pl | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl >index 529a2a6..3b90498 100755 >--- a/opac/opac-userupdate.pl >+++ b/opac/opac-userupdate.pl >@@ -22,6 +22,7 @@ use warnings; > > use CGI; > use Mail::Sendmail; >+use Encode; > > use C4::Auth; # checkauth, getborrowernumber. > use C4::Context; >@@ -102,7 +103,7 @@ EOF > my $B_address2 = $borr->{'B_address2'} || ''; > > foreach my $field (@fields) { >- my $newfield = $query->param($field) || ''; >+ my $newfield = decode('utf-8',$query->param($field)) || ''; > my $borrowerfield = ''; > if($borr->{$field}) { > $borrowerfield = $borr->{$field}; >@@ -124,8 +125,8 @@ EOF > To => $updateemailaddress, > From => $patronemail, > Subject => "User Request for update of Record.", >- Message => $message, >- 'Content-Type' => 'text/plain; charset="utf8"', >+ Message => encode('utf-8', $message), # Mail::Sendmail doesn't like wide characters >+ 'Content-Type' => 'text/plain; charset="utf-8"', > ); > > if ( sendmail %mail ) { >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8953
:
12995
| 12996