Revert r14063; listed as fix for bug 5817 in May 2006 but the behavior seems very...
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 29 Mar 2007 14:17:10 +0000 (14:17 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 29 Mar 2007 14:17:10 +0000 (14:17 +0000)
The listed problem is that the backlink to the target page on Special:Recentchangeslinked shows blue for nonexistent pages, but this patch made it redirect to the nonexistent page, where I'd expect to just change the link coloring. The redirect behavior also makes it tough to work with the category mode for cats where the page hasn't been filled out yet.

includes/SpecialRecentchangeslinked.php

index e116c40..a9c584f 100644 (file)
@@ -24,20 +24,15 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
        $wgOut->setPagetitle( wfMsg( 'recentchangeslinked' ) );
        $sk = $wgUser->getSkin();
 
-       # Validate the title
-       $nt = Title::newFromURL( $target );
-       if( !is_object( $nt ) ) {
-               $wgOut->errorPage( 'notargettitle', 'notargettext' );
+       if (is_null($target)) {
+               $wgOut->errorpage( 'notargettitle', 'notargettext' );
                return;
        }
-       
-       # Check for existence
-       # Do a quiet redirect back to the page itself if it doesn't
-       if( !$nt->exists() ) {
-               $wgOut->redirect( $nt->getLocalUrl() );
+       $nt = Title::newFromURL( $target );
+       if( !$nt ) {
+               $wgOut->errorpage( 'notargettitle', 'notargettext' );
                return;
        }
-
        $id = $nt->getArticleId();
 
        $wgOut->setSubtitle( htmlspecialchars( wfMsg( 'rclsub', $nt->getPrefixedText() ) ) );