commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r588534 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/StringEscapeUtils.java test/org/apache/commons/lang/StringEscapeUtilsTest.java
Date Fri, 26 Oct 2007 06:08:56 GMT
Author: bayard
Date: Thu Oct 25 23:08:54 2007
New Revision: 588534

URL: http://svn.apache.org/viewvc?rev=588534&view=rev
Log:
Applying Scott Bassin's fix and test from LANG-363

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java?rev=588534&r1=588533&r2=588534&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java Thu
Oct 25 23:08:54 2007
@@ -233,6 +233,10 @@
                         out.write('\\');
                         out.write('\\');
                         break;
+                    case '/':
+                        out.write('\\');
+                        out.write('/');
+                        break;
                     default :
                         out.write(ch);
                         break;

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java?rev=588534&r1=588533&r2=588534&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
Thu Oct 25 23:08:54 2007
@@ -184,6 +184,8 @@
         }
         
         assertEquals("He didn\\'t say, \\\"stop!\\\"", StringEscapeUtils.escapeJavaScript("He
didn't say, \"stop!\""));
+        assertEquals("document.getElementById(\\\"test\\\").value = \\'<script>alert(\\'aaa\\');<\\/script>\\';",

+                StringEscapeUtils.escapeJavaScript("document.getElementById(\"test\").value
= '<script>alert('aaa');</script>';"));
     }
 
 



Mime
View raw message