r106740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106739‎ | r106740 | r106741 >
Date:00:25, 20 December 2011
Author:rmoen
Status:reverted (Comments)
Tags:
Comment:
added global Variables hook to use correct edit token
Modified paths:
  • /trunk/extensions/MarkAsHelpful/MarkAsHelpful.hooks.php (modified) (history)
  • /trunk/extensions/MarkAsHelpful/MarkAsHelpful.php (modified) (history)
  • /trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.php
@@ -23,6 +23,7 @@
2424 // Hooks
2525 $wgAutoloadClasses['MarkAsHelpfulHooks'] = dirname(__FILE__).'/MarkAsHelpful.hooks.php';
2626 $wgHooks['BeforePageDisplay'][] = 'MarkAsHelpfulHooks::onPageDisplay';
 27+$wgHooks['MakeGlobalVariablesScript'][] = 'MoodBarHooks::makeGlobalVariablesScript';
2728
2829 // Special pages
2930
Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.hooks.php
@@ -26,4 +26,11 @@
2727
2828 return true;
2929 }
 30+
 31+ public static function makeGlobalVariablesScript( &$vars ) {
 32+ global $wgUser;
 33+ $vars['mahEditToken'] = $wgUser->editToken();
 34+ return true;
 35+ }
 36+
3037 }
\ No newline at end of file
Index: trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js
@@ -79,7 +79,7 @@
8080 'page': mw.config.get( 'wgPageName' ),
8181 'useragent': clientData.name + '/' + clientData.versionNumber,
8282 'system': clientData.platform,
83 - 'token': mw.config.get('mbEditToken'),
 83+ 'token': mw.config.get('mahEditToken'),
8484 'format': 'json'
8585 }, props );
8686

Follow-up revisions

RevisionCommit summaryAuthorDate
r108158remove redundant mahEditToken and use existing user edit token. follow up r10...rmoen18:15, 5 January 2012

Comments

#Comment by Johnduhart (talk | contribs)   23:11, 20 December 2011

There should already be an edit token in the configuration.

Status & tagging log