X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FImagePage.php;h=a83217d5a20db4b882536d287fabf0e089972707;hb=3afc76a4b5ad2f73dd69a82ec08c0d0e4799f00f;hp=997a948f68a4bbf27605d8d93047a900b708b628;hpb=acb83faa0af84a133a875fb1b889815e567d0807;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 997a948f68..a83217d5a2 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -732,7 +732,7 @@ EOT return $dbr->select( array( 'imagelinks', 'page' ), - array( 'page_namespace', 'page_title', 'page_is_redirect', 'il_to' ), + array( 'page_namespace', 'page_title', 'il_to' ), array( 'il_to' => $target, 'il_from = page_id' ), __METHOD__, array( 'LIMIT' => $limit + 1, 'ORDER BY' => 'il_from', ) @@ -743,13 +743,19 @@ EOT $limit = 100; $out = $this->getContext()->getOutput(); - $res = $this->queryImageLinks( $this->getTitle()->getDBkey(), $limit + 1 ); + $rows = array(); $redirects = array(); + foreach ( $this->getTitle()->getRedirectsHere( NS_FILE ) as $redir ) { + $redirects[$redir->getDBkey()] = array(); + $rows[] = (object)array( + 'page_namespace' => NS_FILE, + 'page_title' => $redir->getDBkey(), + ); + } + + $res = $this->queryImageLinks( $this->getTitle()->getDBkey(), $limit + 1 ); foreach ( $res as $row ) { - if ( $row->page_is_redirect ) { - $redirects[$row->page_title] = array(); - } $rows[] = $row; } $count = count( $rows );