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

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   saegeek 

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

Posted 18 May 2012 - 09:34 AM

Hi,
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(
    array('title','required','skip'=>'at_a_specified_scenario'),
);

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.
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,780
  • 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 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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