From: Byron Jones Date: Thu, 4 Jun 2015 13:46:42 +0000 (+0800) Subject: Bug 1134743: javascript filter should escape unicode line and paragraph separators... X-Git-Tag: bugzilla-4.4.10~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85c1d41dad06574a3d48e2795d6c290c221f17c0;p=thirdparty%2Fbugzilla.git Bug 1134743: javascript filter should escape unicode line and paragraph separators (causes "Unterminated string literal" javascript error) r=dylan,a=glob --- diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index acfc5a50f0..72d899c4d7 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -631,6 +631,8 @@ sub create { $var =~ s/([\\\'\"\/])/\\$1/g; $var =~ s/\n/\\n/g; $var =~ s/\r/\\r/g; + $var =~ s/\x{2028}/\\u2028/g; # unicode line separator + $var =~ s/\x{2029}/\\u2029/g; # unicode paragraph separator $var =~ s/\@/\\x40/g; # anti-spam for email addresses $var =~ s//\\x3e/g;