From: Brion Vibber Date: Thu, 29 Mar 2007 14:17:10 +0000 (+0000) Subject: Revert r14063; listed as fix for bug 5817 in May 2006 but the behavior seems very... X-Git-Tag: 1.31.0-rc.0~53545 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=11c3c964112ae57ec5b67c96025a1a6f8f719ea3;p=lhc%2Fweb%2Fwiklou.git Revert r14063; listed as fix for bug 5817 in May 2006 but the behavior seems very unintuitive to me. 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. --- diff --git a/includes/SpecialRecentchangeslinked.php b/includes/SpecialRecentchangeslinked.php index e116c4032c..a9c584f5f9 100644 --- a/includes/SpecialRecentchangeslinked.php +++ b/includes/SpecialRecentchangeslinked.php @@ -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() ) ) );