diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index cc73e43839..1e047b5b6b 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -212,14 +212,10 @@ class ApiVisualEditor extends ApiBase { false // enable write? ); $api->execute(); - if ( defined( 'ApiResult::META_CONTENT' ) ) { - $result = $api->getResult()->getResultData( null, [ - 'BC' => [], // Transform content nodes to '*' - 'Types' => [], // Add back-compat subelements - ] ); - } else { - $result = $api->getResultData(); - } + $result = $api->getResult()->getResultData( null, [ + 'BC' => [], // Transform content nodes to '*' + 'Types' => [], // Add back-compat subelements + ] ); if ( !isset( $result['query']['pages'][$title->getArticleID()]['revisions'][0]['diff']['*'] ) ) { return [ 'result' => 'fail' ]; } @@ -260,15 +256,11 @@ class ApiVisualEditor extends ApiBase { ); $api->execute(); - if ( defined( 'ApiResult::META_CONTENT' ) ) { - $result = $api->getResult()->getResultData( null, [ - 'BC' => [], // Backwards-compatible structure transformations - 'Types' => [], // Backwards-compatible structure transformations - 'Strip' => 'all', // Remove any metadata keys from the langlinks array - ] ); - } else { - $result = $api->getResultData(); - } + $result = $api->getResult()->getResultData( null, [ + 'BC' => [], // Backwards-compatible structure transformations + 'Types' => [], // Backwards-compatible structure transformations + 'Strip' => 'all', // Remove any metadata keys from the langlinks array + ] ); if ( !isset( $result['query']['pages'][$title->getArticleID()]['langlinks'] ) ) { return false; } diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php index bad751fa3c..01cdb7a149 100644 --- a/ApiVisualEditorEdit.php +++ b/ApiVisualEditorEdit.php @@ -53,11 +53,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor { $api->execute(); - if ( defined( 'ApiResult::META_CONTENT' ) ) { - return $api->getResult()->getResultData(); - } else { - return $api->getResultData(); - } + return $api->getResult()->getResultData(); } protected function parseWikitext( $title, $newRevId ) { @@ -77,15 +73,11 @@ class ApiVisualEditorEdit extends ApiVisualEditor { ); $api->execute(); - if ( defined( 'ApiResult::META_CONTENT' ) ) { - $result = $api->getResult()->getResultData( null, [ - 'BC' => [], // Transform content nodes to '*' - 'Types' => [], // Add back-compat subelements - 'Strip' => 'all', // Remove any metadata keys from the links array - ] ); - } else { - $result = $api->getResultData(); - } + $result = $api->getResult()->getResultData( null, [ + 'BC' => [], // Transform content nodes to '*' + 'Types' => [], // Add back-compat subelements + 'Strip' => 'all', // Remove any metadata keys from the links array + ] ); $content = isset( $result['parse']['text']['*'] ) ? $result['parse']['text']['*'] : false; $categorieshtml = isset( $result['parse']['categorieshtml']['*'] ) ? $result['parse']['categorieshtml']['*'] : false; @@ -280,10 +272,6 @@ class ApiVisualEditorEdit extends ApiVisualEditor { return 'csrf'; } - public function getTokenSalt() { - return ''; - } - public function mustBePosted() { return true; }