jenkins-bot has submitted this change and it was merged.

Change subject: Add $robotPolicy parameter to SpecialPage::setHeaders()
......................................................................


Add $robotPolicy parameter to SpecialPage::setHeaders()

Also fix docs for OutputPage::setRobotPolicy()

Bug: 57764
Change-Id: I8b780ca349a2f5d18e857ed707f682d19be0054c
---
M includes/OutputPage.php
M includes/SpecialPage.php
2 files changed, 14 insertions(+), 5 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index a0d7e30..eae5dfd 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -774,9 +774,12 @@
        /**
         * Set the robot policy for the page: 
<http://www.robotstxt.org/meta.html>
         *
-        * @param string $policy the literal string to output as the contents of
-        *   the meta tag.  Will be parsed according to the spec and output in
-        *   standardized form.
+        * @param string|array $policy string such as "noindex,nofollow" or an 
array in this
+        *   format:
+        *   array(
+        *      'index' => 'noindex' // or 'index'
+        *      'follow' => 'nofollow' // or 'follow'
+        *   )
         * @return null
         */
        public function setRobotPolicy( $policy ) {
diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php
index f70a6dc..2f0e5e9 100644
--- a/includes/SpecialPage.php
+++ b/includes/SpecialPage.php
@@ -640,11 +640,17 @@
 
        /**
         * Sets headers - this should be called from the execute() method of 
all derived classes!
+        * @param string|array $robotPolicy string such as "noindex,nofollow" 
or an array in this
+        *   format:
+        *   array(
+        *      'index' => 'noindex' // or 'index'
+        *      'follow' => 'nofollow' // or 'follow'
+        *   )
         */
-       function setHeaders() {
+       function setHeaders( $robotPolicy = "noindex,nofollow" ) {
                $out = $this->getOutput();
                $out->setArticleRelated( false );
-               $out->setRobotPolicy( "noindex,nofollow" );
+               $out->setRobotPolicy( $robotPolicy );
                $out->setPageTitle( $this->getDescription() );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/98255
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b780ca349a2f5d18e857ed707f682d19be0054c
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: leucosticte <nathanlarson3...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Brian Wolff <bawolff...@gmail.com>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: Happy-melon <happy.melon.w...@gmail.com>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to