mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-05 07:44:05 +01:00
extra check for CJavaScriptExpression constructor
This commit is contained in:
@@ -25,9 +25,12 @@ class CJavaScriptExpression
|
||||
|
||||
/**
|
||||
* @param string $code a javascript expression that is to be wrapped by this object
|
||||
* @throws CException if argument is not a string
|
||||
*/
|
||||
public function __construct($code)
|
||||
{
|
||||
if(!is_string($code))
|
||||
throw new CException('Value passed to CJavaScriptExpression should be string.');
|
||||
$this->code=$code;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user