When checking for self links, use Title::getFragment() rather
authorWil Mahan <wmahan@users.mediawiki.org>
Wed, 13 Oct 2004 04:30:19 +0000 (04:30 +0000)
committerWil Mahan <wmahan@users.mediawiki.org>
Wed, 13 Oct 2004 04:30:19 +0000 (04:30 +0000)
than searching for '#', so that self-links escaped with
character entities are handled correctly. Related to
bug 337.

includes/Parser.php

index 1e53ef8..de68f81 100644 (file)
@@ -1312,7 +1312,7 @@ class Parser
                        $text = $wgContLang->convert($text);                    
 
                        if( ( $nt->getPrefixedText() === $this->mTitle->getPrefixedText() ) &&
-                           ( strpos( $link, '#' ) === FALSE ) ) {
+                           ( $nt->getFragment() === '' ) ) {
                                # Self-links are handled specially; generally de-link and change to bold.
                                $s .= $prefix . $sk->makeSelfLinkObj( $nt, $text, '', $trail );
                                continue;