jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Give anons tokens too"
......................................................................
Revert "Give anons tokens too"
Too many failures observed, all for anons.
This reverts commit 98f3e83193c0d2ac8535cda3b5d1d43529dbee64.
Bug: 67171
Change-Id: I03e4c524f357d1b0cab6aaeb7757ab89638b7a7d
---
M includes/specials/SpecialMobileOptions.php
1 file changed, 4 insertions(+), 6 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/specials/SpecialMobileOptions.php
b/includes/specials/SpecialMobileOptions.php
index e05d971..664d37b 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -97,7 +97,7 @@
array( 'class' => 'mw-mf-settings', 'method' => 'POST',
'action' => $action )
);
$aboutMessage = $this->msg(
'mobile-frontend-settings-description' )->parse();
- $token = Html::hidden( 'token', $user->getEditToken( 'mobile' )
);
+ $token = $user->isLoggedIn() ? Html::hidden( 'token',
$user->getEditToken() ) : '';
$returnto = Html::hidden( 'returnto',
$this->returnToTitle->getFullText() );
$alphaEnableMsg = wfMessage( 'mobile-frontend-settings-alpha'
)->parse();
@@ -241,12 +241,10 @@
$request = $this->getRequest();
$user = $this->getUser();
- if ( !$user->matchEditToken( $request->getVal( 'token' ),
'mobile' ) ) {
+ if ( $user->isLoggedIn() && !$user->matchEditToken(
$request->getVal( 'token' ) ) ) {
wfIncrStats( 'mobile.options.errors' );
- $errorText = __METHOD__ . '(): token mismatch, user is '
- . ( $user->isLoggedIn() ? '' : 'not ' )
- . 'logged in';
- wfDebugLog( 'mobile', $errorText );
+ wfDebugLog( 'mobile', __METHOD__ . "(): token mismatch,
expected {$user->getEditToken()}, "
+ . "got {$request->getVal( 'token' )}" );
$this->getOutput()->addHTML( '<div class="error">'
. $this->msg( "mobile-frontend-save-error"
)->parse()
. '</div>'
--
To view, visit https://gerrit.wikimedia.org/r/143799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I03e4c524f357d1b0cab6aaeb7757ab89638b7a7d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits