You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2013/10/16 19:59:30 UTC

svn commit: r1532836 - /myfaces/core/branches/2.1.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java

Author: lu4242
Date: Wed Oct 16 17:59:30 2013
New Revision: 1532836

URL: http://svn.apache.org/r1532836
Log:
MYFACES-3744 Vertical tab character (\u000B) destroys AJAX-response

Modified:
    myfaces/core/branches/2.1.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java

Modified: myfaces/core/branches/2.1.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java?rev=1532836&r1=1532835&r2=1532836&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java (original)
+++ myfaces/core/branches/2.1.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java Wed Oct 16 17:59:30 2013
@@ -103,6 +103,14 @@ public abstract class HTMLEncoder
                     default:
                         break;
                 }
+                // http://www.w3.org/MarkUp/html3/specialchars.html
+                // From C0 extension U+0000-U+001F only U+0009, U+000A and
+                // U+000D are valid control characters
+                if (c <= 0x1F && c != 0x09 && c != 0x0A && c != 0x0D)
+                {
+                    // Ignore escape character
+                    app = "";
+                }
             }
             else if (encodeNonLatin && (int)c > 0x80)
             {
@@ -226,6 +234,14 @@ public abstract class HTMLEncoder
                     default:
                         break;
                 }
+                // http://www.w3.org/MarkUp/html3/specialchars.html
+                // From C0 extension U+0000-U+001F only U+0009, U+000A and
+                // U+000D are valid control characters
+                if (c <= 0x1F && c != 0x09 && c != 0x0A && c != 0x0D)
+                {
+                    // Ignore escape character
+                    app = "";
+                }
             }
             else if (encodeNonLatin && (int)c > 0x80)
             {
@@ -377,6 +393,14 @@ public abstract class HTMLEncoder
                     default:
                         break;
                 }
+                // http://www.w3.org/MarkUp/html3/specialchars.html
+                // From C0 extension U+0000-U+001F only U+0009, U+000A and
+                // U+000D are valid control characters
+                if (c <= 0x1F && c != 0x09 && c != 0x0A && c != 0x0D)
+                {
+                    // Ignore escape character
+                    app = "";
+                }
             }
             else if (encodeNonLatin && (int)c > 0x80)
             {