https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112758

Revision: 112758
Author:   aaron
Date:     2012-03-01 01:45:40 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
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: trunk/extensions/WikiLove/ApiWikiLove.php
===================================================================
--- trunk/extensions/WikiLove/ApiWikiLove.php   2012-03-01 01:41:05 UTC (rev 
112757)
+++ trunk/extensions/WikiLove/ApiWikiLove.php   2012-03-01 01:45:40 UTC (rev 
112758)
@@ -20,16 +20,25 @@
                }
 
                // not using section => 'new' here, as we like to give our own 
edit summary
-               $api = new ApiMain( new FauxRequest( array(
-                       'action' => 'edit',
-                       'title' => $talk->getFullText(),
-                       // need to do this, as Article::replaceSection fails 
for non-existing pages
-                       'appendtext' => ( $talk->exists() ? "\n\n" : '' ) . 
wfMsgForContent( 'newsectionheaderdefaultlevel', $params['subject'] )
-                               . "\n\n" . $params['text'],
-                       'token' => $params['token'],
-                       'summary' => wfMsgForContent( 'wikilove-summary', 
$wgParser->stripSectionName( $params['subject'] ) ),
-                       'notminor' => true,
-               ), false, array( 'wsEditToken' => $wgRequest->getSessionData( 
'wsEditToken' ) ) ), true );
+               $api = new ApiMain(
+                       new DerivativeRequest(
+                               $wgRequest,
+                               array(
+                                       'action'     => 'edit',
+                                       'title'      => $talk->getFullText(),
+                                       // need to do this, as 
Article::replaceSection fails for non-existing pages
+                                       'appendtext' => ( $talk->exists() ? 
"\n\n" : '' ) . 
+                                               wfMsgForContent( 
'newsectionheaderdefaultlevel', $params['subject'] )
+                                               . "\n\n" . $params['text'],
+                                       'token'      => $params['token'],
+                                       'summary'    => wfMsgForContent( 
'wikilove-summary', 
+                                               $wgParser->stripSectionName( 
$params['subject'] ) ),
+                                       'notminor'   => true
+                               ),
+                               false // was posted?
+                       ),
+                       true // enable write?
+               );
 
                $api->execute();
 


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

Reply via email to