Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1682

HtmlHandler can't handle tags not requiring closed tags if the tag names are uppercase

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.3
    • 1.3.4, 1.4-M3
    • wicket
    • None

    Description

      In HtmlHandler.java, the requiresCloseTag() method only looks the tag name in the Map, without considering the char case:

      public static boolean requiresCloseTag(final String name)

      { return doesNotRequireCloseTag.get(name) == null; }

      Because the keys are all lower case:

      static

      { // Tags which are allowed not be closed in HTML doesNotRequireCloseTag.put("p", Boolean.TRUE); doesNotRequireCloseTag.put("br", Boolean.TRUE); doesNotRequireCloseTag.put("img", Boolean.TRUE); doesNotRequireCloseTag.put("input", Boolean.TRUE); doesNotRequireCloseTag.put("hr", Boolean.TRUE); doesNotRequireCloseTag.put("link", Boolean.TRUE); doesNotRequireCloseTag.put("meta", Boolean.TRUE); }

      it will fail if uppercase tag names are used in the markup.

      I've verified that it dies with the following simple markup:

      <html>
      <body>
      <BR>
      </body>
      </html>

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            freemant Kent Tong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: