From 2cb331868b11df4da89117af802ee3079961b3a1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 19 Aug 2005 00:51:34 +0000 Subject: [PATCH] Fixed template parser, I guess we broke it with r127 --- template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template.php b/template.php index 7e61bb5..c0abf50 100644 --- a/template.php +++ b/template.php @@ -503,7 +503,7 @@ class DB_Template // locate else tags else if (substr($template, $i, strlen($tag_else)) == $tag_else) { - if (count($stack) == 0 AND !$tag_full['else']) + if (count($stack) == 0 AND !isset($tag_full['else'])) { $tag_full['else'] = $i; } @@ -539,7 +539,7 @@ class DB_Template $conditional = substr($conditional, 0, strlen($conditional) - strlen($tag_end)); // handle the else - if ($tag_full['else']) + if (isset($tag_full['else'])) { // now relative to the start of the $relpos = $tag_full['else'] - $tag_full['posi']; @@ -569,7 +569,7 @@ class DB_Template // reset the parser $offset = $tag_full['posi'] + strlen($tag_start) + strlen($tag_start_end); - $tag_full = array('posi' => 0, 'else' => 0, 'posf' => 0); + $tag_full = array(); $stack = array(); $parsed = array(); unset($fullspread, $conditional, $temp_end, $relpos, $length, $elsepos); -- 2.22.5