From: leucosticte Date: Mon, 10 Mar 2014 08:57:16 +0000 (-0400) Subject: Add getRobotPolicy() X-Git-Tag: 1.31.0-rc.0~16520 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=0c78bd25c81d6083d082d621fcfc3c7c1f09b821;p=lhc%2Fweb%2Fwiklou.git Add getRobotPolicy() Bug: 57764 Change-Id: I5d53b9b36b8ec5263bf7ebb13c7ef8c102c1ce68 --- 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. *