mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Remove pre-1.25 API compatibility code"
This commit is contained in:
commit
080d0ba8e1
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue