updated CFileValidator to be unsafe

This commit is contained in:
Alexander Makarov
2012-08-03 00:06:21 +04:00
parent 1bb2ea9ca5
commit 1d33c35ea0
2 changed files with 7 additions and 2 deletions

View File

@@ -130,6 +130,12 @@ class CFileValidator extends CValidator
* limit.
*/
public $tooMany;
/**
* @var boolean whether attributes listed with this validator should be considered safe for massive assignment.
* For this validator it defaults to false.
* @since 1.1.12
*/
public $safe=false;
/**
* Set the attribute and then validates using {@link validateFile}.
@@ -244,7 +250,6 @@ class CFileValidator extends CValidator
*/
protected function emptyAttribute($object, $attribute)
{
unset($object->{$attribute});
if(!$this->allowEmpty)
{
$message=$this->message!==null?$this->message : Yii::t('yii','{attribute} cannot be blank.');