aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig/lexer.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-12 22:56:54 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-12 22:56:54 -0500
commitbcb1392351c2da921f477b56ab2c0777e7bbf4fc (patch)
tree154c1f820f4c9ef7197d04cee4b8ed1db599c874 /phpBB/phpbb/template/twig/lexer.php
parent65f52d7575a8a7fe83cbfe7c5f35215ef8fba5b0 (diff)
parent12ede5f2a783bbdb8dc8ba9a94b4cd1ffa750e49 (diff)
downloadforums-bcb1392351c2da921f477b56ab2c0777e7bbf4fc.tar
forums-bcb1392351c2da921f477b56ab2c0777e7bbf4fc.tar.gz
forums-bcb1392351c2da921f477b56ab2c0777e7bbf4fc.tar.bz2
forums-bcb1392351c2da921f477b56ab2c0777e7bbf4fc.tar.xz
forums-bcb1392351c2da921f477b56ab2c0777e7bbf4fc.zip
Merge branch 'develop' of github.com:phpbb/phpbb3 into ticket/11816
# By Joseph Warner (187) and others # Via Nathan Guse (6) and others * 'develop' of github.com:phpbb/phpbb3: (195 commits) [ticket/11828] Fix greedy operators in lexer [ticket/11835] Fix ucp_auth_link adding in migration [prep-release-3.0.12] Remove changelog entry for ticket that was not resolved. [ticket/develop/11832] Fix path detection [feature/oauth] Fix tabindex [ticket/9550] Add the core.viewtopic_post_rowset_data event to viewtopic.php [ticket/11829] Use report_closed to determine status in MCP report_details [feature/oauth] Fix bug on ucp_auth_link related to error display [feature/oauth] More small fixes [feature/oauth] More minor changes from review [feature/oauth] Fix small bug introduced by update in OAuth library [feature/oauth] Fix small issues on ucp pages [feature/oauth] Fix typo in OAuth logout method [feature/oauth] Make token storage service ignorant [feature/oauth] Update oauth::logout() to use clearAllTokens() [feature/oauth] Update storage implementation due to inteface change [feature/oauth] Update lusitanian/oauth to stable branch [ticket/11822] Use namespace lookup order for asset loading [feature/oauth] Update comment on oauth service exception [feature/oauth] Forgot to remove placeholder comment ... Conflicts: phpBB/phpbb/template/twig/lexer.php tests/template/template_test.php
Diffstat (limited to 'phpBB/phpbb/template/twig/lexer.php')
-rw-r--r--phpBB/phpbb/template/twig/lexer.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index 22e2c4ed3e..d47162951d 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -75,7 +75,7 @@ class phpbb_template_twig_lexer extends Twig_Lexer
// Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}')
$code = $this->fix_inline_variable_tokens(array(
- 'DEFINE.+=',
+ 'DEFINE \$[a-zA-Z0-9]+ =',
'INCLUDE',
'INCLUDEPHP',
'INCLUDEJS',
@@ -240,7 +240,7 @@ class phpbb_template_twig_lexer extends Twig_Lexer
return "<!-- {$matches[1]}IF{$inner}-->";
};
- return preg_replace_callback('#<!-- (ELSE)?IF((.*) \(?!?[\$|\.]([^\s]+)(.*))-->#', $callback, $code);
+ return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(?!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
}
/**
@@ -264,10 +264,10 @@ class phpbb_template_twig_lexer extends Twig_Lexer
*/
// Replace <!-- DEFINE $NAME with {% DEFINE definition.NAME
- $code = preg_replace('#<!-- DEFINE \$(.*)-->#', '{% DEFINE $1 %}', $code);
+ $code = preg_replace('#<!-- DEFINE \$(.*?) -->#', '{% DEFINE $1 %}', $code);
// Changing UNDEFINE NAME to DEFINE NAME = null to save from creating an extra token parser/node
- $code = preg_replace('#<!-- UNDEFINE \$(.*)-->#', '{% DEFINE $1= null %}', $code);
+ $code = preg_replace('#<!-- UNDEFINE \$(.*?)-->#', '{% DEFINE $1= null %}', $code);
// Replace all of our variables, {$VARNAME}, with Twig style, {{ definition.VARNAME }}
$code = preg_replace('#{\$([a-zA-Z0-9_\.]+)}#', '{{ definition.$1 }}', $code);