aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-11-08 19:55:16 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2013-11-08 19:55:16 -0600
commitda332aa0a5cbeabbcce5551ee955c701fc2a1d73 (patch)
tree94b2adadcf078b35e0515a3de528e5b4b76e0da6
parentb49d3a1851330d64009c8050132e50b093172559 (diff)
downloadforums-da332aa0a5cbeabbcce5551ee955c701fc2a1d73.tar
forums-da332aa0a5cbeabbcce5551ee955c701fc2a1d73.tar.gz
forums-da332aa0a5cbeabbcce5551ee955c701fc2a1d73.tar.bz2
forums-da332aa0a5cbeabbcce5551ee955c701fc2a1d73.tar.xz
forums-da332aa0a5cbeabbcce5551ee955c701fc2a1d73.zip
[ticket/11943] Require stricter DEFINE statements for templates
PHPBB3-11943
-rw-r--r--phpBB/phpbb/template/twig/lexer.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index 8c52fa65b2..efd6a0bd84 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -69,7 +69,7 @@ class lexer extends \Twig_Lexer
// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')
$code = $this->fix_inline_variable_tokens(array(
- 'DEFINE \$[a-zA-Z0-9_]+ =',
+ //'DEFINE \$[a-zA-Z0-9_]+ =', // Disabling for ticket 11943
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
@@ -129,14 +129,6 @@ class lexer extends \Twig_Lexer
// Replace template variables with start/end to parse variables (' ~ TEST ~ '.html)
$matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]);
- // If the second item is exactly one of a few key words,
- // do not quote it as it changes the meaning
- // http://tracker.phpbb.com/browse/PHPBB3-11943
- if (in_array($matches[2], array('false', 'true', 'null')))
- {
- return "<!-- {$matches[1]} {$matches[2]} -->";
- }
-
// Surround the matches in single quotes ('' ~ TEST ~ '.html')
return "<!-- {$matches[1]} '{$matches[2]}' -->";
};