r112758 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112757‎ | r112758 | r112759 >
Date:01:45, 1 March 2012
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Use DerivativeRequest subclass of FauxRequest in order to pass on IP and Agent info for check user and friends
Modified paths:
  • /trunk/extensions/WikiLove/ApiWikiLove.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiLove/ApiWikiLove.php
@@ -20,16 +20,25 @@
2121 }
2222
2323 // not using section => 'new' here, as we like to give our own edit summary
24 - $api = new ApiMain( new FauxRequest( array(
25 - 'action' => 'edit',
26 - 'title' => $talk->getFullText(),
27 - // need to do this, as Article::replaceSection fails for non-existing pages
28 - 'appendtext' => ( $talk->exists() ? "\n\n" : '' ) . wfMsgForContent( 'newsectionheaderdefaultlevel', $params['subject'] )
29 - . "\n\n" . $params['text'],
30 - 'token' => $params['token'],
31 - 'summary' => wfMsgForContent( 'wikilove-summary', $wgParser->stripSectionName( $params['subject'] ) ),
32 - 'notminor' => true,
33 - ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 'wsEditToken' ) ) ), true );
 24+ $api = new ApiMain(
 25+ new DerivativeRequest(
 26+ $wgRequest,
 27+ array(
 28+ 'action' => 'edit',
 29+ 'title' => $talk->getFullText(),
 30+ // need to do this, as Article::replaceSection fails for non-existing pages
 31+ 'appendtext' => ( $talk->exists() ? "\n\n" : '' ) .
 32+ wfMsgForContent( 'newsectionheaderdefaultlevel', $params['subject'] )
 33+ . "\n\n" . $params['text'],
 34+ 'token' => $params['token'],
 35+ 'summary' => wfMsgForContent( 'wikilove-summary',
 36+ $wgParser->stripSectionName( $params['subject'] ) ),
 37+ 'notminor' => true
 38+ ),
 39+ false // was posted?
 40+ ),
 41+ true // enable write?
 42+ );
3443
3544 $api->execute();
3645

Follow-up revisions

RevisionCommit summaryAuthorDate
r112759MFT r112758aaron01:48, 1 March 2012
r113049MFT r112229, r112248, r112253, r112260, r112758reedy17:46, 5 March 2012

Comments

#Comment by Saper (talk | contribs)   02:00, 1 March 2012

Tested on my trunk wiki, now I get IP address and the user agent in the CheckUser log.

Status & tagging log