Merge "Remove pre-1.25 API compatibility code"

This commit is contained in:
jenkins-bot 2016-09-20 20:51:22 +00:00 committed by Gerrit Code Review
commit 080d0ba8e1
2 changed files with 15 additions and 35 deletions

View file

@ -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();
}
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();
}
if ( !isset( $result['query']['pages'][$title->getArticleID()]['langlinks'] ) ) {
return false;
}

View file

@ -53,11 +53,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
$api->execute();
if ( defined( 'ApiResult::META_CONTENT' ) ) {
return $api->getResult()->getResultData();
} else {
return $api->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();
}
$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;
}