From: Tim Starling Date: Mon, 20 Mar 2006 09:23:18 +0000 (+0000) Subject: fixed error reporting in evaluation of function returns X-Git-Tag: 1.6.0~179 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=71abe5167f701f4212e37f2edcc91145b5ecb012;p=lhc%2Fweb%2Fwiklou.git fixed error reporting in evaluation of function returns --- 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(