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

Page name validation regex is incorrect.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None

      Description

      The validation regex for page names is slightly incorrect. The error message given by the validator is: "... is not a valid page name. Page names must start with a letter and consist only of letters, numbers, period, dash and underscore."

      The regular expression in org.apache.tapestry.parse.SpecificationParser (PAGE_NAME_PATTERN) is:

      "^" + IDENTIFIER_PATTERN + "(/" + IDENTIFIER_PATTERN + ")*$";

      This does not allow a dash in the page name. A more correct is:

      "^" + IDENTIFIER_PATTERN + "(/" + EXTENDED_IDENTIFIER_PATTERN + ")*$";

      This still doesn't allow page names with periods or numbers though. I think that ideally, we're looking for something like this (untested): "^[a-zA-Z](/[_\\-\\.]?[a-zA-Z0-9])*$"

      Cheers.

      • Chris

        Attachments

          Activity

            People

            • Assignee:
              jkuhnert Jesse Kuhnert
              Reporter:
              fuzelogik Chris Davies
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: