mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "ApiVisualEditor: Defensively check that query prop revisions returns arrays"
This commit is contained in:
commit
c9f3f45b9d
|
@ -348,7 +348,8 @@ class ApiVisualEditor extends ApiBase {
|
||||||
$content = false;
|
$content = false;
|
||||||
if ( isset( $result['query']['pages'][$pid]['revisions'] ) ) {
|
if ( isset( $result['query']['pages'][$pid]['revisions'] ) ) {
|
||||||
foreach ( $result['query']['pages'][$pid]['revisions'] as $revArr ) {
|
foreach ( $result['query']['pages'][$pid]['revisions'] as $revArr ) {
|
||||||
if ( $revArr['revid'] === $oldid ) {
|
// Check 'revisions' is an array (T193718)
|
||||||
|
if ( is_array( $revArr ) && $revArr['revid'] === $oldid ) {
|
||||||
$content = $revArr['content'];
|
$content = $revArr['content'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue