[bugzilla-gnome-org-upstream/4.4] Bug 1134743: javascript filter should escape unicode line and paragraph separators (causes "Untermin



commit 85c1d41dad06574a3d48e2795d6c290c221f17c0
Author: Byron Jones <glob mozilla com>
Date:   Thu Jun 4 21:46:42 2015 +0800

    Bug 1134743: javascript filter should escape unicode line and paragraph separators (causes "Unterminated 
string literal" javascript error)
    r=dylan,a=glob

 Bugzilla/Template.pm |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index acfc5a5..72d899c 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/</\\x3c/g;
                 $var =~ s/>/\\x3e/g;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]