Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-244

Template parse errors if unquoted attribute contains a slash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.1
    • 4.2
    • Framework
    • None

    Description

      If a template for a page has unquoted attributes values containing a "/" character then Tapestry throws template-parsing errors. The errors are usually "missing attribute value" or "unmatched close tag" but others are possible.

      The problem occurs because the TemplateParser class assumes that a "/" character means the end of the current tag (ie a "/>"). The code in the startTag() function uses lines like:

      if (ch == '/' || ch == '>')
      // do something

      This is incorrect. The fix is to look ahead for the next character if the current character is a slash):

      if((ch == '/' && lookahead(new char[]

      { '>' }

      )) || ch == '>')
      // do something

      I have tried the fix and it does resolve the issue. The fix needs to be applied to lines 805 and 870 of TemplateParser.java (in v3.0.1).

      Attachments

        Activity

          People

            Unassigned Unassigned
            naeemmalik Naeem Malik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: