Merge "Add PreferencesFormPreSave hook"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 71cb863..9157619 100644 (file)
@@ -710,7 +710,7 @@ class Parser {
                        $t = Title::newFromText( 'NO TITLE' );
                }
 
-               if ( strval( $t->getFragment() ) !== '' ) {
+               if ( $t->hasFragment() ) {
                        # Strip the fragment to avoid various odd effects
                        $this->mTitle = clone $t;
                        $this->mTitle->setFragment( '' );
@@ -1988,7 +1988,7 @@ class Parser {
                        }
 
                        $ns = $nt->getNamespace();
-                       $iw = $nt->getInterWiki();
+                       $iw = $nt->getInterwiki();
                        wfProfileOut( __METHOD__ . "-title" );
 
                        if ( $might_be_img ) { # if this is actually an invalid link
@@ -2120,7 +2120,7 @@ class Parser {
                        # Self-link checking. For some languages, variants of the title are checked in
                        # LinkHolderArray::doVariants() to allow batching the existence checks necessary
                        # for linking to a different variant.
-                       if ( $ns != NS_SPECIAL && $nt->equals( $this->mTitle ) && $nt->getFragment() === '' ) {
+                       if ( $ns != NS_SPECIAL && $nt->equals( $this->mTitle ) && !$nt->hasFragment() ) {
                                $s .= $prefix . Linker::makeSelfLinkObj( $nt, $text, '', $trail );
                                continue;
                        }
@@ -3837,12 +3837,7 @@ class Parser {
                if ( $file && !$title->equals( $file->getTitle() ) ) {
                        # Update fetched file title
                        $title = $file->getTitle();
-                       if ( is_null( $file->getRedirectedTitle() ) ) {
-                               # This file was not a redirect, but the title does not match.
-                               # Register under the new name because otherwise the link will
-                               # get lost.
-                               $this->mOutput->addImage( $title->getDBkey(), $time, $sha1 );
-                       }
+                       $this->mOutput->addImage( $title->getDBkey(), $time, $sha1 );
                }
                return array( $file, $title );
        }