(bug 16806) Fix regression from r44524 that caused links to files to not get added...
authorAlex Z <mrzman@users.mediawiki.org>
Tue, 30 Dec 2008 05:34:37 +0000 (05:34 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Tue, 30 Dec 2008 05:34:37 +0000 (05:34 +0000)
includes/parser/Parser.php

index 4427a01..a2f9b9a 100644 (file)
@@ -1843,6 +1843,11 @@ class Parser
                        # FIXME: isAlwaysKnown() can be expensive for file links; we should really do
                        # batch file existence checks for NS_FILE and NS_MEDIA
                        if( $iw == '' && $nt->isAlwaysKnown() ) {
+                               # Need to add file links to parser output here or else they won't end up
+                               # in the pagelinks table later
+                               if( $ns == NS_FILE ) {
+                                       $this->mOutput->addLink( $nt );
+                               }
                                $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
                        } else {
                                $s .= $holders->makeHolder( $nt, $text, '', $trail, $prefix );