User "Tbleher" posted a comment on MediaWiki.r94640.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94640#c20950
Commit summary:

Removed usage of internal API call in Special:AddComment that was broken by 
r83080; using WikiPage::doEdit() (or Article::doEdit() in earlier MW versions) 
instead.

Comment:

Proposed alternative patch to fix this issue:
<source lang=diff>
--- a/SpecialAddComment_body.php
+++ b/SpecialAddComment_body.php
@@ -81,8 +81,8 @@ class SpecialAddComment extends UnlistedSpecialPage {
                                                'title'   => 
$title->getPrefixedText(),
                                                'text'    => $text,
                                                'summary' => wfMsgForContent( 
'commentbox-log' ),
-                                               'token'   => 
$wgUser->editToken(),
                                                ), true );
+                       $req->setVal( 'token', $wgUser->editToken( '', $req ) );
                        $api = new ApiMain( $req, true );
                        $api->execute();
                        wfDebug( "Completed API-Save\n" );
</source>


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

Reply via email to