Bugzilla – Attachment 42515 Details for
Bug 14813
Encoding issues when editing the help
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14813: Fix encoding issues on editing help pages
Bug-14813-Fix-encoding-issues-on-editing-help-page.patch (text/plain), 2.04 KB, created by
Josef Moravec
on 2015-09-14 11:42:59 UTC
(
hide
)
Description:
Bug 14813: Fix encoding issues on editing help pages
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2015-09-14 11:42:59 UTC
Size:
2.04 KB
patch
obsolete
>From 94807129fb38f4f5e969b599fe1eb71cde33fdc0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 14 Sep 2015 10:28:01 +0100 >Subject: [PATCH] Bug 14813: Fix encoding issues on editing help pages > >It has been introduced by bug 11944. > >Test plan: >1/ Install and set the fr-FR language (or ar-Arab). >2/ Go on the help page and edit it. >3/ The textarea should not contain encoding issues with this patch. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > edithelp.pl | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > >diff --git a/edithelp.pl b/edithelp.pl >index ce0c075..ae2ed9f 100755 >--- a/edithelp.pl >+++ b/edithelp.pl >@@ -17,12 +17,11 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >+use Modern::Perl; > use C4::Output; > use C4::Templates; > use C4::Auth; > use CGI qw ( -utf8 ); >-use warnings; > > use vars qw($debug); > >@@ -77,7 +76,7 @@ sub _get_filepath ($;$) { > $type = 'create' if $type eq 'addnew'; > if ( $type eq 'create' || $type eq 'save' ) { > my $file = _get_filepath($referer); >- open my $fh, ">", $file; >+ open my $fh, ">:encoding(utf-8)", $file; > if ( $fh ) { > # file is open write to it > print $fh >@@ -99,13 +98,13 @@ elsif ( $type eq 'modify' ) { > } else { > (-w $file) or $error = > "WARNING: You will not be able to save, because your webserver cannot write to '$file'. Contact your admin about help file permissions."; >- open (my $fh, '<', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked >- my $help = ''; >+ open (my $fh, '<:encoding(utf-8)', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked >+ my $help = ''; > while ( <$fh> ) { > $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_; >- } >- close $fh; >- $template->param( 'help' => $help ); >+ } >+ close $fh; >+ $template->param( 'help' => $help ); > $type = 'save'; > } > } >-- >2.1.4
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 14813
:
42510
|
42515
|
42543