Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -814,7 +814,7 @@ |
815 | 815 | * @return bool |
816 | 816 | */ |
817 | 817 | function saveCollection( $title, $forceOverwrite = false ) { |
818 | | - global $wgUser; |
| 818 | + global $wgRequest, $wgUser; |
819 | 819 | |
820 | 820 | $article = new Article( $title ); |
821 | 821 | if ( $article->exists() && !$forceOverwrite ) { |
— | — | @@ -861,12 +861,14 @@ |
862 | 862 | } |
863 | 863 | } |
864 | 864 | |
865 | | - $req = new FauxRequest( array( |
866 | | - 'action' => 'edit', |
867 | | - 'title' => $title->getPrefixedText(), |
868 | | - 'text' => $articleText, |
869 | | - 'token' => $wgUser->editToken(), |
870 | | - ), true, $_SESSION ); |
| 865 | + $req = new DerivativeRequest( |
| 866 | + $wgRequest, |
| 867 | + array( |
| 868 | + 'action' => 'edit', |
| 869 | + 'title' => $title->getPrefixedText(), |
| 870 | + 'text' => $articleText, |
| 871 | + 'token' => $wgUser->editToken(), |
| 872 | + ), true); |
871 | 873 | $api = new ApiMain( $req, true ); |
872 | 874 | $api->execute(); |
873 | 875 | return true; |