From: jenkins-bot Date: Fri, 2 Mar 2018 11:10:08 +0000 (+0000) Subject: Merge "User: Remove ::setCookie/etc., deprecated in 1.27" X-Git-Tag: 1.31.0-rc.0~465 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=f88b3acbe8ab2e2042762dde1ef3a282202e0308;hp=47a83ef3385abdca76dc013776f51b9fa09139da;p=lhc%2Fweb%2Fwiklou.git Merge "User: Remove ::setCookie/etc., deprecated in 1.27" --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 78d24f3638..0c4bc680ef 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -269,6 +269,12 @@ changes to languages because of Phabricator reports. * The DeferredStringifier class is deprecated, use Message::listParam() instead. * The type string for the parameter $lang of DateFormatter::getInstance is deprecated. +* In User, the cookie-related methods which were wrappers for the functions on the response + object, and were deprecated in 1.27, have been removed: + * ::setCookie() + * ::clearCookie() + * ::setExtendedLoginCookie() + Note that User::setCookies() remains, and is not deprecated. * The global functions wfProfileIn and wfProfileOut, deprecated in 1.25, have been removed. == Compatibility == diff --git a/includes/user/User.php b/includes/user/User.php index 3102cfcf10..ab791b4caa 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -4052,76 +4052,6 @@ class User implements IDBAccessObject, UserIdentity { } } - /** - * Set a cookie on the user's client. Wrapper for - * WebResponse::setCookie - * @deprecated since 1.27 - * @param string $name Name of the cookie to set - * @param string $value Value to set - * @param int $exp Expiration time, as a UNIX time value; - * if 0 or not specified, use the default $wgCookieExpiration - * @param bool $secure - * true: Force setting the secure attribute when setting the cookie - * false: Force NOT setting the secure attribute when setting the cookie - * null (default): Use the default ($wgCookieSecure) to set the secure attribute - * @param array $params Array of options sent passed to WebResponse::setcookie() - * @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null - * is passed. - */ - protected function setCookie( - $name, $value, $exp = 0, $secure = null, $params = [], $request = null - ) { - wfDeprecated( __METHOD__, '1.27' ); - if ( $request === null ) { - $request = $this->getRequest(); - } - $params['secure'] = $secure; - $request->response()->setCookie( $name, $value, $exp, $params ); - } - - /** - * Clear a cookie on the user's client - * @deprecated since 1.27 - * @param string $name Name of the cookie to clear - * @param bool $secure - * true: Force setting the secure attribute when setting the cookie - * false: Force NOT setting the secure attribute when setting the cookie - * null (default): Use the default ($wgCookieSecure) to set the secure attribute - * @param array $params Array of options sent passed to WebResponse::setcookie() - */ - protected function clearCookie( $name, $secure = null, $params = [] ) { - wfDeprecated( __METHOD__, '1.27' ); - $this->setCookie( $name, '', time() - 86400, $secure, $params ); - } - - /** - * Set an extended login cookie on the user's client. The expiry of the cookie - * is controlled by the $wgExtendedLoginCookieExpiration configuration - * variable. - * - * @see User::setCookie - * - * @deprecated since 1.27 - * @param string $name Name of the cookie to set - * @param string $value Value to set - * @param bool $secure - * true: Force setting the secure attribute when setting the cookie - * false: Force NOT setting the secure attribute when setting the cookie - * null (default): Use the default ($wgCookieSecure) to set the secure attribute - */ - protected function setExtendedLoginCookie( $name, $value, $secure ) { - global $wgExtendedLoginCookieExpiration, $wgCookieExpiration; - - wfDeprecated( __METHOD__, '1.27' ); - - $exp = time(); - $exp += $wgExtendedLoginCookieExpiration !== null - ? $wgExtendedLoginCookieExpiration - : $wgCookieExpiration; - - $this->setCookie( $name, $value, $exp, $secure ); - } - /** * Persist this user's session (e.g. set cookies) *