r13426 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13425‎ | r13426 | r13427 >
Date:04:14, 2 April 2006
Author:brion
Status:old
Tags:
Comment:
Live fix: session token vanishing logging
FIXME: uses wikimedia paths, needs to be generalized
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1689,13 +1689,12 @@
16901690 */
16911691 function matchEditToken( $val, $salt = '' ) {
16921692 global $wgMemc;
1693 -
1694 -/*
1695 - if ( !isset( $_SESSION['wsEditToken'] ) ) {
 1693+ $sessionToken = $this->editToken( $salt );
 1694+ if ( $val != $sessionToken ) {
16961695 $logfile = '/home/wikipedia/logs/session_debug/session.log';
16971696 $mckey = memsess_key( session_id() );
16981697 $uname = @posix_uname();
1699 - $msg = "wsEditToken not set!\n" .
 1698+ $msg = date('r') . "\nEdit token mismatch, expected $sessionToken got $val\n" .
17001699 'apache server=' . $uname['nodename'] . "\n" .
17011700 'session_id = ' . session_id() . "\n" .
17021701 '$_SESSION=' . var_export( $_SESSION, true ) . "\n" .
@@ -1704,8 +1703,7 @@
17051704
17061705 @error_log( $msg, 3, $logfile );
17071706 }
1708 -*/
1709 - return ( $val == $this->editToken( $salt ) );
 1707+ return $val == $sessionToken;
17101708 }
17111709
17121710 /**

Status & tagging log