jenkins-bot has submitted this change and it was merged.

Change subject: Uncomment token check in Special:MobileOptions
......................................................................


Uncomment token check in Special:MobileOptions

Tested live - it works properly with current Varnish configuration

Change-Id: I0c1697e73cdca22131085cdad4d4b9d75ccede88
---
M MobileFrontend.i18n.php
M includes/specials/SpecialMobileOptions.php
2 files changed, 8 insertions(+), 2 deletions(-)

Approvals:
  awjrichards: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index 7b31651..e5d918f 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -36,6 +36,7 @@
        'mobile-frontend-settings-alpha' => 'Experimental mode',
        'mobile-frontend-settings-alpha-description' => 'Enter dangerous and 
unexplored mobile territory. Get even more experimental features, but with more 
danger of bugs.',
        'mobile-frontend-save-settings' => 'Save',
+       'mobile-frontend-save-error' => 'Error saving settings. Please make 
sure that you have cookies enabled.',
        'mobile-frontend-random-button' => 'Random',
 
        'mobile-frontend-back-to-top-of-section' => 'Jump back a section',
diff --git a/includes/specials/SpecialMobileOptions.php 
b/includes/specials/SpecialMobileOptions.php
index db9bdfc..46225ec 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -191,8 +191,13 @@
                $request = $this->getRequest();
 
                if ( $request->getVal( 'token' ) != $context->getMobileToken() 
) {
-                       wfDebug( __METHOD__ . "(): token mismatch\n" );
-                       //return; // Display something here?
+                       wfDebugLog( 'mobile', __METHOD__ . "(): token mismatch" 
);
+                       $this->getOutput()->addHTML( '<div class="error">'
+                               . $this->msg( "mobile-frontend-save-error" 
)->parse()
+                               . '</div>'
+                       );
+                       $this->getSettingsForm();
+                       return;
                }
                if ( $request->getBool( 'enableAlpha' ) ) {
                        $group = 'alpha';

-- 
To view, visit https://gerrit.wikimedia.org/r/80389
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c1697e73cdca22131085cdad4d4b9d75ccede88
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: awjrichards <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to