mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Using MediaWiki facility for HTTP post
Change-Id: If800c4ecbcbecc8560bfd3e704e03acac2ac71d9
This commit is contained in:
parent
a2231cb6ca
commit
60fc5a3c58
|
@ -27,12 +27,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
} elseif ($params['paction'] === 'save') {
|
||||
// API Posts HTML to Parsoid Service, receives Wikitext,
|
||||
// API Saves Wikitext to page.
|
||||
$c = curl_init( $parsoid.$page );
|
||||
curl_setopt($c, CURLOPT_POST, 1);
|
||||
curl_setopt($c, CURLOPT_POSTFIELDS, 'content='.$params['html']);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
|
||||
$wikitext = curl_exec($c);
|
||||
curl_close($c);
|
||||
$wikitext = Http::post( $parsoid.$page, array( 'postData' => 'content='.$params['html'] ) );
|
||||
|
||||
if ( $wikitext ) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue