Add the global correctly
[lhc/web/wiklou.git] / includes / Article.php
index 2b7e9a5..d0a9725 100644 (file)
@@ -393,7 +393,6 @@ class Article implements Page {
                return $this->mContent;
        }
 
-
        /**
         * Get text content object
         * Does *NOT* follow redirects.
@@ -420,7 +419,7 @@ class Article implements Page {
                # Pre-fill content with error message so that if something
                # fails we'll have something telling us what we intended.
                //XXX: this isn't page content but a UI message. horrible.
-               $this->mContentObject = new MessageContent( 'missing-revision', array( $oldid ), array() ) ;
+               $this->mContentObject = new MessageContent( 'missing-revision', array( $oldid ), array() );
 
                if ( $oldid ) {
                        # $this->mRevision might already be fetched by getOldIDFromRequest()
@@ -767,6 +766,8 @@ class Article implements Page {
                $this->showViewFooter();
                $this->mPage->doViewUpdates( $user );
 
+               $outputPage->addModules( 'mediawiki.action.view.postEdit' );
+
                wfProfileOut( __METHOD__ );
        }
 
@@ -1089,6 +1090,7 @@ class Article implements Page {
        public function showMissingArticle() {
                global $wgSend404Code;
                $outputPage = $this->getContext()->getOutput();
+               $validUserPage = false;
 
                # Show info in user (talk) namespace. Does the user exist? Is he blocked?
                if ( $this->getTitle()->getNamespace() == NS_USER || $this->getTitle()->getNamespace() == NS_USER_TALK ) {
@@ -1115,6 +1117,9 @@ class Article implements Page {
                                                )
                                        )
                                );
+                               $validUserPage = true;
+                       } else {
+                               $validUserPage = true;
                        }
                }
 
@@ -1128,7 +1133,7 @@ class Article implements Page {
                                'msgKey' => array( 'moveddeleted-notice' ) )
                );
 
-               if ( !$this->mPage->hasViewableContent() && $wgSend404Code ) {
+               if ( !$this->mPage->hasViewableContent() && $wgSend404Code && !$validUserPage ) {
                        // If there's no backing content, send a 404 Not Found
                        // for better machine handling of broken links.
                        $this->getContext()->getRequest()->response()->header( "HTTP/1.1 404 Not Found" );
@@ -1268,7 +1273,7 @@ class Article implements Page {
                                        'oldid' => $oldid
                                ) + $extraParams
                        );
-               $prev = $this->getTitle()->getPreviousRevisionID( $oldid ) ;
+               $prev = $this->getTitle()->getPreviousRevisionID( $oldid );
                $prevlink = $prev
                        ? Linker::linkKnown(
                                $this->getTitle(),