jenkins-bot has submitted this change and it was merged.

Change subject: User getExtendedLoginCookieExpiration from core
......................................................................


User getExtendedLoginCookieExpiration from core

Use the new core method (introduced in f22772942)
to avoid repeating this logic.

Change-Id: Iea489b7767a57d6fa5e08fbfadf86164754bcece
---
M includes/CentralAuthUser.php
1 file changed, 2 insertions(+), 8 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 0b73807..153f941 100755
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2316,7 +2316,7 @@
         */
        static function setCookie( $name, $value, $exp = -1, $secure = null, 
$prefix = false ) {
                global $wgCentralAuthCookiePrefix, $wgCentralAuthCookieDomain,
-                       $wgCookieExpiration, $wgCentralAuthCookiePath, 
$wgExtendedLoginCookieExpiration;
+                       $wgCentralAuthCookiePath;
 
                if ( CentralAuthHooks::hasApiToken() ) {
                        throw new Exception( "Cannot set cookies when API 
'centralauthtoken' parameter is given" );
@@ -2325,13 +2325,7 @@
                self::setP3P();
 
                if ( $exp == -1 ) {
-                       $exp = time();
-
-                       if ( $wgExtendedLoginCookieExpiration !== null ) {
-                               $exp += $wgExtendedLoginCookieExpiration;
-                       } else {
-                               $exp += $wgCookieExpiration;
-                       }
+                       $exp = time() + 
User::getExtendedLoginCookieExpiration();
                } elseif ( $exp == 0 ) {
                        // Session cookie
                        $exp = null;

-- 
To view, visit https://gerrit.wikimedia.org/r/231491
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iea489b7767a57d6fa5e08fbfadf86164754bcece
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to