[ticket/11323] Correctly treat variables in template defines

Previously, any template variables that were used when defining a variable
were treated as strings. This is a regression to phpBB 3.0. With this
patch the template variables will be properly parsed.

PHPBB3-11323
[ticket/11323] Enable tests for inclusion of defined variables

PHPBB3-11323
[ticket/11323] Reduce additional code and revert regex to previous one

PHPBB3-11323
Merge remote-tracking branch 'remotes/marc/ticket/11323' into develop

# By Marc Alexander
# Via Marc Alexander
* remotes/marc/ticket/11323:
  [ticket/11323] Reduce additional code and revert regex to previous one
  [ticket/11323] Enable tests for inclusion of defined variables
  [ticket/11323] Correctly treat variables in template defines