diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 6df177e126..56168b94b5 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -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 diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index 3606d5faec..da9601d1a4 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -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); } /**