Skip to content

Commit

Permalink
Item12285: Check if escape really needed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Dec 10, 2012
1 parent 3d82c68 commit 8dcf9a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/lib/Foswiki/Macros/MAKETEXT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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} || "";
Expand Down

0 comments on commit 8dcf9a0

Please sign in to comment.