* Template.php:
(BSTemplate::evaluate): Don't call ob_end_clean()
- New: Implement Iterator in BSDBResult
- New: In the BSTemplate::$preParseHook method, the second parameter will be the BSTemplate object itself
- New: Add BSTemplate::$globalVars to be substituted into every template
+- Change: BSTemplate will better detect parse errors in nested templates in BSTemplate::evaluate()
ob_start();
$this->template = str_replace(array('$this->', 'self::'), 'null', $this->template); // don't want internal access coming from a template
$this->template = '?>' . $this->template;
- eval($this->template);
- $this->template = ob_get_clean();
- ob_end_clean();
+ $test = eval($this->template);
+ $output = ob_get_clean();
+ if ($output === false)
+ {
+ throw new Exception('A parse error was encountered while evaluating the template');
+ }
+
+ $this->template = $output;
return $this;
}