Revision #11 has been created by Kostas Apazidis (KonApaz) on Jul 15, 2013, 7:15:58 PM with the memo:
"safe" and "unsafe" Model validators (massive assignments)
« previous (#10) next (#12) »
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?');
}[...]