Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-15310

Cannot use braces in template files

    XMLWordPrintable

Details

    Description

      If you try to use something that contains braces {} in a template file, there is a chance to have it fail without being noticed.

      Example: if I wan to use a regex pattern in an input field, I could put something like the following:

      pattern="#[0-9a-fA-F]{6}"

      This is silently translated into HTML as pattern="#[0-9a-fA-F]6"

      I have tried all kinds of variations, and all fail one way or other.  I was able to make it work with the following two alternatives:

      pattern="#[0-9a-fA-F]{6,6}" // Use a min and max repetition boundary

      pattern="#[0-9a-fA-F]{{ '{' }}6{{ '}' }}" // Use Twig escaping for the braces

      This is a legitimate use of braces, so I think this should be fixed.  The major issue is that it does not give any clue of what is happening or why, so it will be extremely difficult to track as a bug.

      Attachments

        Activity

          People

            Marc Marc
            javiexin javiexin [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: