From 0c78bd25c81d6083d082d621fcfc3c7c1f09b821 Mon Sep 17 00:00:00 2001 From: leucosticte Date: Mon, 10 Mar 2014 04:57:16 -0400 Subject: [PATCH] Add getRobotPolicy() Bug: 57764 Change-Id: I5d53b9b36b8ec5263bf7ebb13c7ef8c102c1ce68 --- includes/specialpage/SpecialPage.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/specialpage/SpecialPage.php b/includes/specialpage/SpecialPage.php index 91a2de2dd4..e824a613a2 100644 --- a/includes/specialpage/SpecialPage.php +++ b/includes/specialpage/SpecialPage.php @@ -350,7 +350,7 @@ class SpecialPage { function setHeaders() { $out = $this->getOutput(); $out->setArticleRelated( false ); - $out->setRobotPolicy( "noindex,nofollow" ); + $out->setRobotPolicy( $this->getRobotPolicy() ); $out->setPageTitle( $this->getDescription() ); } @@ -587,6 +587,17 @@ class SpecialPage { return $this->getContext()->getTitle(); } + /** + * Return the robot policy. Derived classes that override this can change + * the robot policy set by setHeaders() from the default 'noindex,nofollow'. + * + * @return string + * @since 1.23 + */ + protected function getRobotPolicy() { + return 'noindex,nofollow'; + } + /** * Wrapper around wfMessage that sets the current context. * -- 2.20.1