diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index a66ed0cc53..d69f2e42bf 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -5,11 +5,12 @@ Yii Framework 2 Change Log 2.0.9 under development ----------------------- +- Enh #8795: Refactored `yii\web\User::loginByCookie()` in order to make it easier to override (maine-mike, silverfire) - Enh #11195: Added ability to append custom string to schema builder column definition (df2, samdark) - Enh #8795: Move Identity Cookie code into separate functions and cleanup invalid identity cookies - Enh #8795: Move Identity Cookie code into separate functions and cleanup invalid identity cookies (maine-mike) - Enh #8795 Move Identity Cookie code into separate functions and cleanup invalid identity cookies (maine-mike) --•Enh #11195: Added ability to append custom string to schema builder column definition (df2, samdark) +- Enh #11195: Added ability to append custom string to schema builder column definition (df2, samdark) - Enh #11195: Added ability to append custom string to schema builder column definition (df2, samdark) - Enh #11490: Added `yii\data\ArrayDataProvider::$modelClass` property to specify a model used to provide column labels even when data array is empty (PowerGamer1) - Enh #11591: Added support for wildcards for `only` and `except` at `yii\base\ActionFilter` (klimov-paul) diff --git a/framework/UPGRADE.md b/framework/UPGRADE.md index 188341f2bd..d28ae89e10 100644 --- a/framework/UPGRADE.md +++ b/framework/UPGRADE.md @@ -15,6 +15,12 @@ php composer.phar self-update php composer.phar global require "fxp/composer-asset-plugin:~1.1.1" ``` +Upgrade from Yii 2.0.8 +---------------------- + +* Part of code from `yii\web\User::loginByCookie()` method was moved to new `getIdentityAndDurationFromCookie()` + and `removeIdentityCookie()` methods. If you override `loginByCookie()` method, update it in order use new methods. + Upgrade from Yii 2.0.7 ---------------------- diff --git a/framework/web/User.php b/framework/web/User.php index 1a53cf5c86..36687e61b2 100644 --- a/framework/web/User.php +++ b/framework/web/User.php @@ -549,12 +549,13 @@ class User extends Component * This method attempts to authenticate a user using the information in the identity cookie. * @return array|null Returns an array of 'identity' and 'duration' if valid, otherwise null. * @see loginByCookie() + * @since 2.0.9 */ protected function getIdentityAndDurationFromCookie() { $value = Yii::$app->getRequest()->getCookies()->getValue($this->identityCookie['name']); if ($value === null) { - return; + return null; } $data = json_decode($value, true); if (count($data) == 3) { @@ -573,12 +574,13 @@ class User extends Component } } $this->removeIdentityCookie(); - return; + return null; } /** * Removes the identity cookie. * This method is used when [[enableAutoLogin]] is true. + * @since 2.0.9 */ protected function removeIdentityCookie() {