From 2248698e538e9f01549f79c74e17acce3dfe229b Mon Sep 17 00:00:00 2001
From: Meik Sievertsen <acydburn@phpbb.com>
Date: Sun, 13 Apr 2003 12:28:57 +0000
Subject: faster (for me), especially for topics with a bunch of attachments
 (due to the nested block vars).

git-svn-id: file:///svn/phpbb/trunk@3825 89ea8834-ac86-4346-8a33-228a782c2dd0
---
 phpBB/includes/template.php | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index 74790c6e96..888cdb2905 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -284,22 +284,18 @@ class Template {
 			// Nested block.
 			$blocks = explode('.', $blockname);
 			$blockcount = sizeof($blocks) - 1;
-			$str = '$this->_tpldata';
 
-			for ($i = 0; $i < $blockcount; $i++)
+			$str = &$this->_tpldata; 
+			for ($i = 0; $i < $blockcount; $i++) 
 			{
-				$str .= '[\'' . $blocks[$i] . '.\']';
-				eval('$lastiteration = sizeof(' . $str . ') - 1;');
-				$str .= '[' . $lastiteration . ']';
-			}
+				$str = &$str[$blocks[$i] . '.']; 
+				$str = &$str[sizeof($str) - 1]; 
+			} 
 
 			// Now we add the block that we're actually assigning to.
 			// We're adding a new iteration to this block with the given
 			// variable assignments.
-			$str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;';
-
-			// Now we evaluate this assignment we've built up.
-			eval($str);
+			$str[$blocks[$blockcount] . '.'][] = $vararray;
 		}
 		else
 		{
-- 
cgit v1.2.1