X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FImageQueryPage.php;h=75f7ba640b5002d74397d34c03723e1d9ad31a18;hb=d1e3c987c996add061a3ca54eb432269b8e32774;hp=b9ec6e027aa4db65c7ff4c92b7b3b13a6438e2ef;hpb=fd03fc043c8a0e670b09526ebc0571dac0d582fb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ImageQueryPage.php b/includes/ImageQueryPage.php index b9ec6e027a..75f7ba640b 100644 --- a/includes/ImageQueryPage.php +++ b/includes/ImageQueryPage.php @@ -41,12 +41,13 @@ abstract class ImageQueryPage extends QueryPage { * @param int $offset Paging offset */ protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) { - if( $num > 0 ) { - $gallery = new ImageGallery(); + if ( $num > 0 ) { + $gallery = ImageGalleryBase::factory(); + $gallery->setContext( $this->getContext() ); # $res might contain the whole 1,000 rows, so we read up to # $num [should update this to use a Pager] - for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) { + for ( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) { $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE; $title = Title::makeTitleSafe( $namespace, $row->title ); if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {