From 635460fa6dda70be8ae8b36c4c4be012c9c0a590 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 11 May 2011 09:12:52 -0400 Subject: [PATCH] [feature/template-engine] Fixed reference usage. Hopefully this is right, I have not checked it against the manual (assuming the manual even covers these things). PHPBB3-9726 --- phpBB/includes/template/context.php | 6 +++++- phpBB/includes/template/renderer_eval.php | 2 +- phpBB/includes/template/renderer_include.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/template/context.php b/phpBB/includes/template/context.php index c667282f7b..695f6e0ed3 100644 --- a/phpBB/includes/template/context.php +++ b/phpBB/includes/template/context.php @@ -68,11 +68,15 @@ class phpbb_template_context public function get_data_ref() { - return $this->tpldata; + // returning a reference directly is not + // something php is capable of doing + $ref = &$this->tpldata; + return $ref; } public function get_root_ref() { + // rootref is already a reference return $this->rootref; } diff --git a/phpBB/includes/template/renderer_eval.php b/phpBB/includes/template/renderer_eval.php index a3d7f88fa5..f3365ff8a7 100644 --- a/phpBB/includes/template/renderer_eval.php +++ b/phpBB/includes/template/renderer_eval.php @@ -50,7 +50,7 @@ class phpbb_template_renderer_eval implements phpbb_template_renderer */ public function render($context, $lang) { - $_template = &$this->template; + $_template = $this->template; $_tpldata = &$context->get_data_ref(); $_rootref = &$context->get_root_ref(); $_lang = &$lang; diff --git a/phpBB/includes/template/renderer_include.php b/phpBB/includes/template/renderer_include.php index aca3a3634d..28a8027df3 100644 --- a/phpBB/includes/template/renderer_include.php +++ b/phpBB/includes/template/renderer_include.php @@ -50,7 +50,7 @@ class phpbb_template_renderer_include implements phpbb_template_renderer */ public function render($context, $lang) { - $_template = &$this->template; + $_template = $this->template; $_tpldata = &$context->get_data_ref(); $_rootref = &$context->get_root_ref(); $_lang = &$lang;