mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 11:39:41 +08:00
Fix #19804: Change $this->oldAttributes to $this->_oldAttributes to avoid calling a method unnecessarily
This commit is contained in:
@ -24,6 +24,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #19770: Fix `yii\mutex\MysqlMutex` `keyPrefix` expression param binding (kamarton)
|
||||
- Enh #19794: Add caching in `yii\web\Request` for `getUserIP()` and `getSecureForwardedHeaderTrustedParts()` (rhertogh)
|
||||
- Bug #19795: Fix `yii\web\Response::redirect()` to prevent setting headers with URL containing new line character (bizley)
|
||||
- Enh #19804: Change `$this->oldAttributes` to `$this->_oldAttributes` to avoid calling a method unnecessarily (thiagotalma)
|
||||
|
||||
2.0.47 November 18, 2022
|
||||
------------------------
|
||||
|
||||
@ -1762,8 +1762,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
|
||||
*/
|
||||
private function isAttributeDirty($attribute, $value)
|
||||
{
|
||||
$old_attribute = $this->oldAttributes[$attribute];
|
||||
if (is_array($value) && is_array($this->oldAttributes[$attribute])) {
|
||||
$old_attribute = $this->_oldAttributes === null || !array_key_exists($attribute, $this->_oldAttributes) ? [] : $this->_oldAttributes[$attribute];
|
||||
if (is_array($value) && is_array($this->_oldAttributes[$attribute])) {
|
||||
$value = ArrayHelper::recursiveSort($value);
|
||||
$old_attribute = ArrayHelper::recursiveSort($old_attribute);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user