Merge "Bug 41234 - api prop=imageinfo broken on PHP 5.4"
authorNikerabbit <niklas.laxstrom@gmail.com>
Sat, 20 Oct 2012 14:03:52 +0000 (14:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 20 Oct 2012 14:03:52 +0000 (14:03 +0000)
includes/api/ApiQueryImageInfo.php

index ee55fb5..de02614 100644 (file)
@@ -172,7 +172,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
 
                        $data = $this->getResultData();
                        foreach ( $data['query']['pages'] as $pageid => $arr ) {
-                               if ( !isset( $arr['imagerepository'] ) ) {
+                               if ( is_array( $arr ) && !isset( $arr['imagerepository'] ) ) {
                                        $result->addValue(
                                                array( 'query', 'pages', $pageid ),
                                                'imagerepository', ''