aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-07-08 15:16:37 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-07-08 15:16:37 -0500
commit70a553e0b5471c32469961be40e408bd544b670f (patch)
tree3b95f93234d6d2bbdbfa744136aeb69b49697257 /phpBB
parent0894a1377013965657f29a42202a630ba83daf95 (diff)
downloadforums-70a553e0b5471c32469961be40e408bd544b670f.tar
forums-70a553e0b5471c32469961be40e408bd544b670f.tar.gz
forums-70a553e0b5471c32469961be40e408bd544b670f.tar.bz2
forums-70a553e0b5471c32469961be40e408bd544b670f.tar.xz
forums-70a553e0b5471c32469961be40e408bd544b670f.zip
[feature/twig] Variable regular expressions should be lazy
PHPBB3-11598
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/template/twig/lexer.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/includes/template/twig/lexer.php b/phpBB/includes/template/twig/lexer.php
index 5f76c44481..d0a84a8b7f 100644
--- a/phpBB/includes/template/twig/lexer.php
+++ b/phpBB/includes/template/twig/lexer.php
@@ -98,15 +98,15 @@ class phpbb_template_twig_lexer extends Twig_Lexer
// Replace all of our language variables, {L_VARNAME}, with Twig style, {{ lang('NAME') }}
// Appends any filters after lang()
- $code = preg_replace('#{L_([a-zA-Z0-9_\.]+)(\|[^}]+)?}#', '{{ lang(\'$1\')$2 }}', $code);
+ $code = preg_replace('#{L_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2 }}', $code);
// Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|addslashes }}
// Appends any filters after lang(), but before addslashes
- $code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+)?}#', '{{ lang(\'$1\')$2|addslashes }}', $code);
+ $code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2|addslashes }}', $code);
// Replace all of our variables, {VARNAME}, with Twig style, {{ VARNAME }}
// Appends any filters
- $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+)?}#', '{{ $1$2 }}', $code);
+ $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code);
return parent::tokenize($code, $filename);
}