Title: Use a more proper way of detecting whether interwikis are local
[lhc/web/wiklou.git] / includes / Title.php
index 829be44..d0d77e3 100644 (file)
@@ -1464,7 +1464,9 @@ class Title implements LinkTarget {
        public function getFragmentForURL() {
                if ( !$this->hasFragment() ) {
                        return '';
-               } elseif ( $this->isExternal() && !$this->getTransWikiID() ) {
+               } elseif ( $this->isExternal()
+                       && !self::getInterwikiLookup()->fetch( $this->mInterwiki )->isLocal()
+               ) {
                        return '#' . Sanitizer::escapeIdForExternalInterwiki( $this->getFragment() );
                }
                return '#' . Sanitizer::escapeIdForLink( $this->getFragment() );