Permalink
Browse files

Enh #1053: CComponent::evaluateExpression allow using global function…

…s as callbacks fixed 2
  • Loading branch information...
1 parent 1cbbebd commit 3af0e26d32e78d2e5db57dfcdbd5e202a6865617 @Ekstazi Ekstazi committed Jul 29, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 framework/base/CComponent.php
@@ -582,7 +582,7 @@ public function raiseEvent($name,$event)
*
* Valid PHP callback can be class method name in the form of
* array(ClassName/Object, MethodName), or anonymous function (only available in PHP 5.3.0 or above),
- * or global function name.
+ * or global function name.
*
* If a PHP callback is used, the corresponding function/method signature should be
* <pre>
@@ -611,7 +611,8 @@ public function evaluateExpression($_expression_,$_data_=array())
{
extract($_data_);
return eval('return '.$_expression_.';');
- }
+ }else
+ throw new CException('Invalid callback passed');
}
}

0 comments on commit 3af0e26

Please sign in to comment.