mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +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;
|
||||
if ( isset( $result['query']['pages'][$pid]['revisions'] ) ) {
|
||||
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'];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue