From 71abe5167f701f4212e37f2edcc91145b5ecb012 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 20 Mar 2006 09:23:18 +0000 Subject: [PATCH] fixed error reporting in evaluation of function returns --- includes/cbt/CBTProcessor.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/cbt/CBTProcessor.php b/includes/cbt/CBTProcessor.php index 8fc7006f4b..6afae325f3 100644 --- a/includes/cbt/CBTProcessor.php +++ b/includes/cbt/CBTProcessor.php @@ -114,8 +114,13 @@ class CBTValue { $myProcessor = new CBTProcessor( $this->mText, $processor->mFunctionObj, $processor->mIgnorableDeps ); $myProcessor->mCompiling = $processor->mCompiling; $val = $myProcessor->doText( 0, strlen( $this->mText ) ); - $this->mText = $val->mText; - $this->addDeps( $val ); + if ( $myProcessor->getLastError() ) { + $processor->error( $myProcessor->getLastError() ); + $this->mText = ''; + } else { + $this->mText = $val->mText; + $this->addDeps( $val ); + } if ( !$processor->mCompiling ) { $this->mIsTemplate = false; } @@ -144,6 +149,8 @@ class CBTProcessor { $mCompiling = false, # True if compiling to a template, false if executing to text $mIgnorableDeps = array(), # Dependency names which should be treated as static $mFunctionCache = array(), # A cache of function results keyed by argument hash + $mLastError = false, # Last error message or false for no error + $mErrorPos = 0, # Last error position /** Built-in functions */ $mBuiltins = array( -- 2.20.1