From 360ba51b58db4a25ec9cc70270f6dcb50ce7d9c7 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 24 Jun 2014 21:28:50 -0700 Subject: [PATCH] Set noindex,nofollow on missing (404) pages * This used to be done until a0e83700a678dd813bf5173bac7f30e67d48c706 by mistake Change-Id: I77c96363e472c5cb87183ba7d6458241b76d8ed1 --- includes/page/Article.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/page/Article.php b/includes/page/Article.php index 967ca07aed..8a72815b3a 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1209,12 +1209,10 @@ class Article implements Page { $this->getContext()->getRequest()->response()->header( "HTTP/1.1 404 Not Found" ); } - if ( $validUserPage ) { - // Also apply the robot policy for nonexisting user pages (as those aren't served as 404) - $policy = $this->getRobotPolicy( 'view' ); - $outputPage->setIndexPolicy( $policy['index'] ); - $outputPage->setFollowPolicy( $policy['follow'] ); - } + // Also apply the robot policy for nonexisting pages (even if a 404 was used for sanity) + $policy = $this->getRobotPolicy( 'view' ); + $outputPage->setIndexPolicy( $policy['index'] ); + $outputPage->setFollowPolicy( $policy['follow'] ); $hookResult = wfRunHooks( 'BeforeDisplayNoArticleText', array( $this ) ); -- 2.20.1