extra check for CJavaScriptExpression constructor

This commit is contained in:
Alexander Makarov
2012-08-07 16:03:42 +04:00
parent 99f03cec97
commit 473e396952

View File

@@ -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;
}