Yii Framework Forum: CModel validate() - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

CModel validate() whitelist are nice but blacklist too... Rate Topic: ****- 1 Votes

#1 User is offline   saegeek 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 246
  • Joined: 09-December 09
  • Location:Montpellier - France

Posted 18 May 2012 - 09:34 AM

There is also another case where a blacklist could be useful.
When there are thousands of model attributes a blacklist is more quick than a whitelist :
This could be very time saving.

one dirty example:
if ($model->validate('*',array('except'=>'title'))) 

My another suggestion for a blacklist was @ model rules:
public function rules() {
return array(

And [for] their saying, "Indeed, we have killed the Messiah, Jesus, the son of Mary, the messenger of God ." And they did not kill him, nor did they crucify him; but [another] was made to resemble him to them. And indeed, those who differ over it are in doubt about it. They have no knowledge of it except the following of assumption. And they did not kill him, for certain.Rather, God raised him to Himself.

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,225
  • Joined: 17-January 09
  • Location:Russia

Posted 21 June 2012 - 09:49 AM

It can lead to significant security issues. Will not be in Yii core.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users