r38711 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38710‎ | r38711 | r38712 >
Date:13:54, 6 August 2008
Author:werdna
Status:old
Tags:
Comment:
Ignore self-links for special pages. They might be there for a good reason, and the current parsing of special-page output means that a link from any subpage of a special page to the special page itself is considered to be a self-link. This is evil, and doesn't take into account parameters added to other parts of the URL (e.g. the unblock form on Special:Ipblocklist)
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -1745,7 +1745,7 @@
17461746 }
17471747
17481748 # Self-link checking
1749 - if( $nt->getFragment() === '' ) {
 1749+ if( $nt->getFragment() === '' && $nt->getNamespace() != NS_SPECIAL ) {
17501750 if( in_array( $nt->getPrefixedText(), $selflink, true ) ) {
17511751 $s .= $prefix . $sk->makeSelfLinkObj( $nt, $text, '', $trail );
17521752 continue;

Status & tagging log