Uploaded image for project: 'Apache Freemarker'
  1. Apache Freemarker
  2. FREEMARKER-109

Invalid function signature - IAE when loading TLD functions with line breaks.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.27-incubating, 2.3.28
    • 2.3.29
    • jsp
    • None

    Description

      When a taglib descriptor file contains a function definition with line breaks in the function signature, the TaglibFactory fails to load the taglib with an ``IllegalArgumentException`` complaining about an invalid function signature.

      The pattern ``FUNCTION_SIGNATURE_PATTERN`` from ``TagLibMethodUtil`` does not support function signatures containing newline characters.

      However, having the ability for newline characters is important to maintain readability with the FQNs.

      I did not see any reason why line breaks would be forbidden in TLD files as the taglib can be loaded by our application and the XML definition clearly states this as allowed

      I have attached an example. And I believe fixing this will not be that big of a deal.
      Maybe setting the flag ``Pattern.DOTALL`` is enough to resolve this.

      Attachments

        1. FreemarkerIssueDemo.java
          0.1 kB
          Magnus Leßmann
        2. demo.tld
          1 kB
          Magnus Leßmann
        3. demo.ftl
          0.1 kB
          Magnus Leßmann

        Activity

          People

            Unassigned Unassigned
            markl4yg Magnus Leßmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: