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

Change subject: (bug 40665) Watch/Unwatch must be POSTed and pass token.
......................................................................


(bug 40665) Watch/Unwatch must be POSTed and pass token.

I think this was caused by r88522.

Change-Id: Ibb0fcba5d70cf7045d9280445f63ee4914ff9fc6
---
M LiquidThreads.php
M lqt.js
2 files changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Helder.wiki: Looks good to me, but someone else must approve
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/LiquidThreads.php b/LiquidThreads.php
index c49ed61..0de9a1d 100644
--- a/LiquidThreads.php
+++ b/LiquidThreads.php
@@ -83,6 +83,7 @@
                'jquery.ui.dialog',
                'jquery.ui.droppable',
                'mediawiki.action.edit.preview',
+               'user.tokens',
        ),
        'messages' => $lqtMessages
 );
diff --git a/lqt.js b/lqt.js
index 82b6376..66a8f2f 100644
--- a/lqt.js
+++ b/lqt.js
@@ -801,13 +801,18 @@
                button.empty().addClass( 'mw-small-spinner' );
 
                // Do the AJAX call.
-               var apiParams = { 'action' : 'watch', 'title' : title, 'format' 
: 'json' };
+               var apiParams = {
+                       'action': 'watch',
+                       'title' : title,
+                       'format': 'json',
+                       'token' : mw.user.tokens.get( 'watchToken' )
+               };
 
                if (action === 'unwatch') {
                        apiParams.unwatch = 'yes';
                }
 
-               $.get( mw.util.wikiScript( 'api' ), apiParams,
+               $.post( mw.util.wikiScript( 'api' ), apiParams,
                        function () {
                                threadLevelCommands.load( 
window.location.href+' '+
                                                
'#'+threadLevelCommands.attr('id')+' > *' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb0fcba5d70cf7045d9280445f63ee4914ff9fc6
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Helder.wiki <helder.w...@gmail.com>
Gerrit-Reviewer: Krinkle <ttij...@wikimedia.org>
Gerrit-Reviewer: MZMcBride <w...@mzmcbride.com>
Gerrit-Reviewer: Martineznovo <martinezn...@gmail.com>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to