r13436 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13435‎ | r13436 | r13437 >
Date:00:53, 3 April 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 5432) Fix inconsistencies in cookie names when using table prefixes
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1346,22 +1346,22 @@
13471347 }
13481348
13491349 function setCookies() {
1350 - global $wgCookieExpiration, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgDBname;
 1350+ global $wgCookieExpiration, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookiePrefix;
13511351 if ( 0 == $this->mId ) return;
13521352 $this->loadFromDatabase();
13531353 $exp = time() + $wgCookieExpiration;
13541354
13551355 $_SESSION['wsUserID'] = $this->mId;
1356 - setcookie( $wgDBname.'UserID', $this->mId, $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1356+ setcookie( $wgCookiePrefix.'UserID', $this->mId, $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
13571357
13581358 $_SESSION['wsUserName'] = $this->getName();
1359 - setcookie( $wgDBname.'UserName', $this->getName(), $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1359+ setcookie( $wgCookiePrefix.'UserName', $this->getName(), $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
13601360
13611361 $_SESSION['wsToken'] = $this->mToken;
13621362 if ( 1 == $this->getOption( 'rememberpassword' ) ) {
1363 - setcookie( $wgDBname.'Token', $this->mToken, $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1363+ setcookie( $wgCookiePrefix.'Token', $this->mToken, $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
13641364 } else {
1365 - setcookie( $wgDBname.'Token', '', time() - 3600 );
 1365+ setcookie( $wgCookiePrefix.'Token', '', time() - 3600 );
13661366 }
13671367 }
13681368
@@ -1370,17 +1370,17 @@
13711371 * It will clean the session cookie
13721372 */
13731373 function logout() {
1374 - global $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgDBname;
 1374+ global $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookiePrefix;
13751375 $this->loadDefaults();
13761376 $this->setLoaded( true );
13771377
13781378 $_SESSION['wsUserID'] = 0;
13791379
1380 - setcookie( $wgDBname.'UserID', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
1381 - setcookie( $wgDBname.'Token', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1380+ setcookie( $wgCookiePrefix.'UserID', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1381+ setcookie( $wgCookiePrefix.'Token', '', time() - 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
13821382
13831383 # Remember when user logged out, to prevent seeing cached pages
1384 - setcookie( $wgDBname.'LoggedOut', wfTimestampNow(), time() + 86400, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1384+ setcookie( $wgCookiePrefix.'LoggedOut', wfTimestampNow(), time() + 86400, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
13851385 }
13861386
13871387 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -731,7 +731,9 @@
732732 enable it.
733733 * (bug 5277) Use audio/midi rather that audio/mid
734734 * (bug 5410) Use namespace name when a custom namespace's nstab-NS message is nonexistent
 735+* (bug 5432) Fix inconsistencies in cookie names when using table prefixes
735736
 737+
736738 === Caveats ===
737739
738740 Some output, particularly involving user-supplied inline HTML, may not

Status & tagging log