r12598 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12597‎ | r12598 | r12599 >
Date:02:54, 11 January 2006
Author:vibber
Status:old
Tags:
Comment:
* Cleanup and error checking on Special:Listredirects
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialListredirects.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialListredirects.php
@@ -37,15 +37,23 @@
3838 $rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' );
3939
4040 # Find out where the redirect leads
41 - $rd_page = new Article( &$rd_title, 0 );
42 - $rd_text = $rd_page->getContent( true ); # Don't follow the redirect
 41+ $revision = Revision::newFromTitle( $rd_title );
 42+ if( $revision ) {
 43+ # Make a link to the destination page
 44+ $target = Title::newFromRedirect( $revision->getText() );
 45+ if( $target ) {
 46+ $targetLink = $skin->makeKnownLinkObj( $target );
 47+ } else {
 48+ /** @todo Put in some decent error display here */
 49+ $targetLink = '*';
 50+ }
 51+ } else {
 52+ /** @todo Put in some decent error display here */
 53+ $targetLink = '*';
 54+ }
4355
44 - # Make a link to the destination page
45 - $tp_title = Title::newFromRedirect( $rd_text );
46 - $tp_link = $skin->makeKnownLinkObj( $tp_title );
47 -
4856 # Format the whole thing and return it
49 - return( $rd_link . ' → ' . $tp_link );
 57+ return( $rd_link . ' → ' . $targetLink );
5058
5159 }
5260
Index: trunk/phase3/RELEASE-NOTES
@@ -455,6 +455,7 @@
456456 * Skip loading of RecentChange.php except where needed
457457 * Enforce $wgSVGMaxSize when rendering, even for SVGs with a very large source
458458 size. This is necessary to limit server memory usage.
 459+* Cleanup and error checking on Special:Listredirects
459460
460461
461462 === Caveats ===

Status & tagging log