1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[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
This commit is contained in:
Oleg Pudeyev
2011-04-24 22:46:34 -04:00
parent e10d62badc
commit 5afc0b9b90
4 changed files with 29 additions and 4 deletions

View File

@@ -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