Bugzilla – Attachment 119245 Details for
Bug 28094
Fix bad encoding of OVERRIDE_SYSPREF_LibraryName
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28094: Deal with encoding for overriden sysprefs
Bug-28094-Deal-with-encoding-for-overriden-syspref.patch (text/plain), 1.26 KB, created by
Lucas Gass
on 2021-04-06 20:38:53 UTC
(
hide
)
Description:
Bug 28094: Deal with encoding for overriden sysprefs
Filename:
MIME Type:
Creator:
Lucas Gass
Created:
2021-04-06 20:38:53 UTC
Size:
1.26 KB
patch
obsolete
>From 2033f0e6922f60853e50337e56ea7be10ccc3f0b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Apr 2021 16:26:23 +0200 >Subject: [PATCH] Bug 28094: Deal with encoding for overriden sysprefs >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The string we retrieved is UTF-8 encoded, to prevent encoding issue we >must decode it first. > >Test plan: >Easily testable with LibraryName: >1. edit /etc/apache2/sites-available/kohadev.conf >2. Add > RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of â¤ï¸" >3. restart_all >4. Hit the mainpage and look at the source (or title) and confirm that >the string is displayed correcty > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > C4/Context.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 06bdf08e44..01c33b438c 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -405,7 +405,7 @@ sub preference { > my $self = shift; > my $var = shift; # The system preference to return > >- return $ENV{"OVERRIDE_SYSPREF_$var"} >+ return Encode::decode_utf8($ENV{"OVERRIDE_SYSPREF_$var"}) > if defined $ENV{"OVERRIDE_SYSPREF_$var"}; > > $var = lc $var; >-- >2.11.0
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 28094
:
119221
|
119245
|
119369