| Index: trunk/phase3/includes/Article.php |
| — | — | @@ -3332,7 +3332,7 @@ |
| 3333 | 3333 | $rollbackErrors = $this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser ); |
| 3334 | 3334 | $errors = array_merge( $editErrors, wfArrayDiff2( $rollbackErrors, $editErrors ) ); |
| 3335 | 3335 | |
| 3336 | | - $t = new Token( Token::PERSISTENT, array( $this->mTitle->getPrefixedText(), $fromP ) ); |
| | 3336 | + $t = new Token( array( $this->mTitle->getPrefixedText(), $fromP ) ); |
| 3337 | 3337 | if ( !$t->match( $token ) ) { |
| 3338 | 3338 | $errors[] = array( 'sessionfailure' ); |
| 3339 | 3339 | } |
| Index: trunk/phase3/includes/Token.php |
| — | — | @@ -1,6 +1,6 @@ |
| 2 | 2 | <?php |
| 3 | 3 | /** |
| 4 | | - * Copyright © 2003 Brion Vibber <brion@pobox.com> |
| | 4 | + * Copyright © 2010 |
| 5 | 5 | * http://www.mediawiki.org/ |
| 6 | 6 | * |
| 7 | 7 | * This program is free software; you can redistribute it and/or modify |
| — | — | @@ -102,7 +102,7 @@ |
| 103 | 103 | * @param $request WebRequest most of the time you'll want to get/store |
| 104 | 104 | * the tokens in $wgRequest, which is the default. |
| 105 | 105 | */ |
| 106 | | - public function __construct( $salt, $type = self::ANONYMOUS, WebRequest $request = null ){ |
| | 106 | + public function __construct( $salt, $type = self::PERSISTENT, WebRequest $request = null ){ |
| 107 | 107 | global $wgRequest; |
| 108 | 108 | $this->type = $type; |
| 109 | 109 | |
| — | — | @@ -181,7 +181,7 @@ |
| 182 | 182 | * @param $type Token class constant identifier |
| 183 | 183 | * @return String token string to store in HTML |
| 184 | 184 | */ |
| 185 | | - public static function prepare( $salt, $type = self::ANONYMOUS ){ |
| | 185 | + public static function prepare( $salt, $type = self::PERSISTENT ){ |
| 186 | 186 | $t = new Token( $salt, $type ); |
| 187 | 187 | return $t->set( false ); |
| 188 | 188 | } |
| Index: trunk/phase3/includes/Linker.php |
| — | — | @@ -1500,10 +1500,7 @@ |
| 1501 | 1501 | $query = array( |
| 1502 | 1502 | 'action' => 'rollback', |
| 1503 | 1503 | 'from' => $rev->getUserText(), |
| 1504 | | - 'token' => Token::prepare( |
| 1505 | | - Token::PERSISTENT, |
| 1506 | | - array( $title->getPrefixedText(), $rev->getUserText() ) |
| 1507 | | - ), |
| | 1504 | + 'token' => Token::prepare( array( $title->getPrefixedText(), $rev->getUserText() ) ), |
| 1508 | 1505 | ); |
| 1509 | 1506 | if ( $wgRequest->getBool( 'bot' ) ) { |
| 1510 | 1507 | $query['bot'] = '1'; |
| Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
| — | — | @@ -78,10 +78,7 @@ |
| 79 | 79 | if ( !$wgUser->isAllowed( 'rollback' ) ) { |
| 80 | 80 | return false; |
| 81 | 81 | } |
| 82 | | - return Token::prepare( |
| 83 | | - Token::PERSISTENT, |
| 84 | | - array( $title->getPrefixedText(), $rev->getUserText() ) |
| 85 | | - ); |
| | 82 | + return Token::prepare( array( $title->getPrefixedText(), $rev->getUserText() ) ); |
| 86 | 83 | } |
| 87 | 84 | |
| 88 | 85 | public function execute() { |