Merge "ApiVisualEditor: Defensively check that query prop revisions returns arrays"

This commit is contained in:
jenkins-bot 2018-05-30 22:03:35 +00:00 committed by Gerrit Code Review
commit c9f3f45b9d

View file

@ -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'];
} }
} }