Changes
Title
unchanged
"safe" and "unsafe" Model validators (massive assignments)
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
safe, unsafe, validators, scenarios, model
Content
changed
[...]
$model = new Article;
$isblacklist = false;
}
if (isset($_POST['Article'])) {
$model->attributes = isset($_POST['Article'];
if ($model->validate()) {
$model->save(false)
} else {
if ($isblacklist) $model->addError('text_user_input','Are you an ambitious hacker eh?');
}[...]