Add getRobotPolicy()
authorleucosticte <nathanlarson3141@gmail.com>
Mon, 10 Mar 2014 08:57:16 +0000 (04:57 -0400)
committerAddshore <addshorewiki@gmail.com>
Mon, 24 Mar 2014 14:10:31 +0000 (14:10 +0000)
Bug: 57764
Change-Id: I5d53b9b36b8ec5263bf7ebb13c7ef8c102c1ce68

includes/specialpage/SpecialPage.php

index 91a2de2..e824a61 100644 (file)
@@ -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.
         *