Fix #11252 use strict comparison on hasAttribute()

close #11256
This commit is contained in:
Angel Guevara
2016-04-01 02:27:27 -06:00
committed by Carsten Brandt
parent d2dd232b6f
commit 6b6fa96319
2 changed files with 2 additions and 1 deletions

View File

@ -59,6 +59,7 @@ Yii Framework 2 Change Log
- Bug #10613: Fixed PostgreSQL Schema to return correct column names for unique indexes that have mixed case column names (cebe)
- Bug #11322: Fixed incorrect error message in `yii\validators\UniqueValidator` for composite `targetAttribute` (PowerGamer1, silverfire, cebe)
- Chg #11364: Updated jQuery dependency to include versions `1.12.*` (cebe)
- Bug #11252: Use strict comparison on ActiveRecord::hasAttribute() to avoid cases where it returns true when a number is passed to it (Faryshta)
2.0.8 April 28, 2016

View File

@ -424,7 +424,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
*/
public function hasAttribute($name)
{
return isset($this->_attributes[$name]) || in_array($name, $this->attributes());
return isset($this->_attributes[$name]) || in_array($name, $this->attributes(), true);
}
/**