Merge "Send 404 in various special pages when there're no results"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 24 Jul 2014 19:39:41 +0000 (19:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 24 Jul 2014 19:39:41 +0000 (19:39 +0000)
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialContributions.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialWhatlinkshere.php

index 008200d..80c612f 100644 (file)
@@ -54,6 +54,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                if ( $rows === false ) {
                        if ( !$this->including() ) {
                                $this->doHeader( $opts );
+                               $this->getOutput()->setStatusCode( 404 );
                        }
 
                        return;
index 251ac51..a884a39 100644 (file)
@@ -255,6 +255,9 @@ class SpecialContributions extends IncludableSpecialPage {
                                                wfEscapeWikiText( $userObj->getName() ),
                                        )
                                );
+                               if ( !$this->including() ) {
+                                       $this->getOutput()->setStatusCode( 404 );
+                               }
                        }
                        $user = htmlspecialchars( $userObj->getName() );
                } else {
index aa8ed82..c3d9d3e 100644 (file)
@@ -344,6 +344,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                                $this->msg( 'recentchanges-noresult' )->parse() .
                                '</div>'
                        );
+                       if ( !$this->including() ) {
+                               $this->getOutput()->setStatusCode( 404 );
+                       }
                } else {
                        $this->getOutput()->addHTML( $rclistOutput );
                }
index 81d40cc..b92ede5 100644 (file)
@@ -208,6 +208,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                                        }
                                        $errMsg = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
                                        $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
+                                       $out->setStatusCode( 404 );
                                }
                        }