From 8dcf9a06cdf28b838d9f4df47a27a467fd89a133 Mon Sep 17 00:00:00 2001 From: GeorgeClark Date: Mon, 10 Dec 2012 04:24:58 +0000 Subject: [PATCH] Item12285: Check if escape really needed Not necessary if we are not using Locale::Maketext, or if the patched version has been installed. git-svn-id: http://svn.foswiki.org/trunk@16180 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- core/lib/Foswiki/Macros/MAKETEXT.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/lib/Foswiki/Macros/MAKETEXT.pm b/core/lib/Foswiki/Macros/MAKETEXT.pm index e5ac028f98..b94722bad9 100644 --- a/core/lib/Foswiki/Macros/MAKETEXT.pm +++ b/core/lib/Foswiki/Macros/MAKETEXT.pm @@ -4,6 +4,11 @@ package Foswiki; use strict; use warnings; +use Locale::Maketext; +my $escape = + ( $Foswiki::cfg{UserInterfaceInternationalisation} + && ( Locale::Maketext->VERSION() < 1.23 ) ); + my $max; my $min; my $param_error; @@ -31,7 +36,7 @@ sub MAKETEXT { $str =~ s/~\[(\*,\_(\d+),[^,]+(,([^,]+))?)~\]/ _validate($1, $2)/ge; return $str if ($param_error); - $str =~ s#\\#\\\\#g; + $str =~ s#\\#\\\\#g if $escape; # get the args to be interpolated. my $argsStr = $params->{args} || "";