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

Twig DEFINE error when set to another variable

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 3.2.0-RC1
    • None
    • Template Engine
    • PHP 5.6.26, MySQL 5.7.9, Firefox 49.0.2

    Description

      Line 44 of phpbb\template\twig\defineparser.php

      throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename());

      incorrectly throws an error when you use define to set a variable to the value of another e.g.

      <!-- DEFINE $RANKS_TITLE = RANK_TITLE -->

      gives

      Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Invalid DEFINE in "template.html" at line xx' in phpbb\template\twig\tokenparser\defineparser.php:44

      however these all work fine

      <!-- DEFINE $RANKS_TITLE = something.RANK_TITLE -->
      <!-- DEFINE $RANKS_TITLE = (RANK_TITLE or RANK_NAME) -->

      Commenting out this line works around the issue so I think it should be expected to work this way.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: