From 9796c91fd60477b461fa5cdfa9292fdb9e86ef02 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Dec 2010 13:52:28 +0100 Subject: [PATCH] JavaScript-String-Escaping --- SL/Template/Plugin/L.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index f776af85c..844c88dd2 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -21,6 +21,12 @@ sub _H { return $::locale->quote_special_chars('HTML', $string); } +sub _J { + my $string = "" . shift; + $string =~ s/\"/\\\"/g; + return $string; +} + sub _hashify { return (@_ && (ref($_[0]) eq 'HASH')) ? %{ $_[0] } : @_; } -- 2.20.1