diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-24 22:46:34 -0400 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-24 23:13:13 -0400 |
| commit | 5afc0b9b905814718ed0292fa5cc7342786c1fca (patch) | |
| tree | 0efab8e912045ebba7ef199dc45f58ef2892c1e5 /phpBB | |
| parent | e10d62badc2653d53f326cc1a3b8ab00617bc736 (diff) | |
| download | forums-5afc0b9b905814718ed0292fa5cc7342786c1fca.tar forums-5afc0b9b905814718ed0292fa5cc7342786c1fca.tar.gz forums-5afc0b9b905814718ed0292fa5cc7342786c1fca.tar.bz2 forums-5afc0b9b905814718ed0292fa5cc7342786c1fca.tar.xz forums-5afc0b9b905814718ed0292fa5cc7342786c1fca.zip | |
[feature/template-engine] Corrected an off-by-one error in nested namespaces.
This error resulted in a dot from the namespace being placed into
variable reference in compiled template code, thus creating bogus
compiled template code.
PHPBB3-9726
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/template_compile.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/includes/template_compile.php b/phpBB/includes/template_compile.php index 07e497eca4..cba402f83b 100644 --- a/phpBB/includes/template_compile.php +++ b/phpBB/includes/template_compile.php @@ -520,7 +520,11 @@ class phpbb_template_filter extends php_user_filter if (!empty($varrefs[1])) { $namespace = substr($varrefs[1], 0, -1); - $namespace = (strpos($namespace, '.') === false) ? $namespace : strrchr($namespace, '.'); + $dot_pos = strrchr($namespace, '.'); + if ($dot_pos !== false) + { + $namespace = substr($dot_pos, 1); + } // S_ROW_COUNT is deceptive, it returns the current row number not the number of rows // hence S_ROW_COUNT is deprecated in favour of S_ROW_NUM |
