r79586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79585‎ | r79586 | r79587 >
Date:16:02, 4 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Only list images that actually exist
Modified paths:
  • /trunk/extensions/Push/includes/Push_Tab.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Push/includes/Push_Tab.php
@@ -423,7 +423,11 @@
424424 foreach ( $response['query']['pages'] as $page ) {
425425 if ( array_key_exists( 'images', $page ) ) {
426426 foreach ( $page['images'] as $image ) {
427 - $images[] = $image['title'];
 427+ $title = Title::newFromText( $image['title'], NS_FILE );
 428+
 429+ if ( !is_null( $title ) && $title->getNamespace() == NS_FILE && $title->exists() ) {
 430+ $images[] = $image['title'];
 431+ }
428432 }
429433 }
430434 }

Status & tagging log