From: Tyler Anthony Romeo Date: Tue, 30 Apr 2013 17:07:40 +0000 (-0400) Subject: Fixed $wgCookieExpiration functionality when set to 0. X-Git-Tag: 1.31.0-rc.0~19286 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=c2c40b2b9b18457de40f7bda43c4f32edea05275;p=lhc%2Fweb%2Fwiklou.git Fixed $wgCookieExpiration functionality when set to 0. When $wgCookieExpiration is set to 0, cookies should by default expire when the browser closes. However, MediaWiki accidentally interpreted this as the cookies expiring 0 seconds from the request time. Bug: 47886 Change-Id: Ib988ad18574122a56b0d11c8888c7c41d94dea6e --- diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 0deae965ac..c2193fbd84 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -54,7 +54,7 @@ class WebResponse { public function setcookie( $name, $value, $expire = 0, $prefix = null, $domain = null, $forceSecure = null ) { global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain; global $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly; - if ( $expire == 0 ) { + if ( $expire == 0 && $wgCookieExpiration != 0 ) { $expire = time() + $wgCookieExpiration; } if ( $prefix === null ) {