Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 861801 Details for
Bug 1029016
Locale::Maketext interpolating escaped backslashes improperly
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Upstream fix ported to 5.8.8
perl-5.8.8-Commit-1735f6f53ca19f99c6e9e39496c486af323ba6a8-star.patch (text/plain), 3.56 KB, created by
Petr Pisar
on 2014-02-11 14:51:57 UTC
(
hide
)
Description:
Upstream fix ported to 5.8.8
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2014-02-11 14:51:57 UTC
Size:
3.56 KB
patch
obsolete
>From 3ed34a2e65f9dda88b8fc708453661587c84cf55 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?=3D=3FUTF-8=3Fq=3FPetr=3D20P=3DC3=3DADsa=3DC5=3D99=3F=3D?= > <ppisar@redhat.com> >Date: Fri, 8 Nov 2013 02:17:08 +0100 >Subject: [PATCH] Commit 1735f6f53ca19f99c6e9e39496c486af323ba6a8 started to > escape all back-slashes which breaks case when lexicon translations contain > substition and literals with eval-non-safe characters. E.g. these > translations: >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >"[_1]foo\\n\n" => "[_1]bar\\n\n", >'[_1]foo\n' => '[_1]aÃÂa\n', > >got doubled back-slashes on the maketext() output. > >This patch de-escapes escaped backslashes if the literal is compiled as >function argument. > >Fixes RT #120457. > >Petr Pisar: Ported to perl-5.8.8. Explicit deescaping $big_pile is >needed because this old Locale::Maketext::_compile() does not have >shortcut for literals before the while() loop. > >Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com> >--- > MANIFEST | 1 + > lib/Locale/Maketext/Guts.pm | 2 ++ > lib/Locale/Maketext/t/91_backslash.t | 33 +++++++++++++++++++++++++++++++++ > 3 files changed, 36 insertions(+) > create mode 100644 lib/Locale/Maketext/t/91_backslash.t > >diff --git a/MANIFEST b/MANIFEST >index f7d56b5..8027398 100644 >--- a/MANIFEST >+++ b/MANIFEST >@@ -1559,6 +1559,7 @@ lib/Locale/Maketext/t/40_super.t See if Locale::Maketext works > lib/Locale/Maketext/t/50_super.t See if Locale::Maketext works > lib/Locale/Maketext/t/60_super.t See if Locale::Maketext works > lib/Locale/Maketext/t/90_utf8.t See if Locale::Maketext works >+lib/Locale/Maketext/t/91_backslash.t See if Locale::Maketext works > lib/Locale/Maketext/TPJ13.pod Locale::Maketext documentation article > lib/locale.pm For "use locale" > lib/Locale/Script.pm Locale::Codes >diff --git a/lib/Locale/Maketext/Guts.pm b/lib/Locale/Maketext/Guts.pm >index c183b64..c09a6bb 100644 >--- a/lib/Locale/Maketext/Guts.pm >+++ b/lib/Locale/Maketext/Guts.pm >@@ -77,6 +77,7 @@ sub _compile { > push @code, q{ '} . $c[-1] . "',\n"; > $c[-1] = ''; # reuse this slot > } else { >+ $c[-1] =~ s/\\\\/\\/g; > push @code, ' $c[' . $#c . "],\n"; > push @c, ''; # new chunk > } >@@ -222,6 +223,7 @@ sub _compile { > } else { > # It's all literals! Ahwell, that can happen. > # So don't bother with the eval. Return a SCALAR reference. >+ $big_pile =~ s/\\\\/\\/g; > return \$big_pile; > } > >diff --git a/lib/Locale/Maketext/t/91_backslash.t b/lib/Locale/Maketext/t/91_backslash.t >new file mode 100644 >index 0000000..f96edd1 >--- /dev/null >+++ b/lib/Locale/Maketext/t/91_backslash.t >@@ -0,0 +1,33 @@ >+#!/usr/bin/perl -Tw >+ >+use strict; >+use Test::More tests => 6; >+ >+BEGIN { >+ use_ok( 'Locale::Maketext' ); >+} >+ >+use utf8; >+ >+{ >+ package My::Localize; >+ our @ISA = ('Locale::Maketext'); >+} >+{ >+ package My::Localize::cs_cz; >+ our @ISA = ('My::Localize'); >+ our %Lexicon = ( >+ '[_1]foo1\n' => '[_1]bar\n', >+ '[_1]foo2\n' => '[_1]bÄr\n', >+ 'foo2\n' => 'aÄa\n', >+ "[_1]foo\\n\n" => "[_1]bar\\n\n", >+ ); >+ keys %Lexicon; # dodges the 'used only once' warning >+} >+ >+my $lh = My::Localize->get_handle('cs_cz'); >+isa_ok( $lh, 'My::Localize::cs_cz' ); >+is( $lh->maketext('[_1]foo1\n', 'arg'), 'argbar\n', 'Safe parameterized' ); >+is( $lh->maketext('[_1]foo2\n', 'arg'), 'argbÄr\n', 'Unicode parameterized' ); >+is( $lh->maketext('foo2\n'), 'aÄa\n', 'Unicode literal' ); >+is( $lh->maketext("[_1]foo\\n\n", 'arg'), "argbar\\n\n", 'new line parameterized' ); >-- >1.8.5.3 >
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
Attachments on
bug 1029016
:
861777
| 861801