From: Aryeh Gregor Date: Wed, 23 Jul 2008 19:25:48 +0000 (+0000) Subject: Follow-up to r37968: forgot to commit the change setRobotpolicy -> setRobotPolicy... X-Git-Tag: 1.31.0-rc.0~46400 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=0e7fa5b28bb675c81495e847e0f0db117f1b4772;p=lhc%2Fweb%2Fwiklou.git Follow-up to r37968: forgot to commit the change setRobotpolicy -> setRobotPolicy in extensions. --- diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 5284e6211b..ca2a113307 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -105,6 +105,8 @@ class MagicWord { 'numberofadmins', 'defaultsort', 'pagesincategory', + 'index', + 'noindex', ); /* Array of caching hints for ParserCache */ @@ -153,6 +155,8 @@ class MagicWord { 'noeditsection', 'newsectionlink', 'hiddencat', + 'index', + 'noindex', ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index b9e0ceef98..404f94aeed 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3380,6 +3380,15 @@ class Parser wfDebug( __METHOD__.": [[MediaWiki:hidden-category-category]] is not a valid title!\n" ); } } + # (bug 8068) Allow control over whether robots index a page. FIXME: + # __INDEX__ always overrides __NOINDEX__ here! This is not desirable, + # the last one on the page should win. + if( isset( $this->mDoubleUnderscores['noindex'] ) ) { + $this->mOutput->setIndexPolicy( 'noindex' ); + } elseif( isset( $this->mDoubleUnderscores['index'] ) ) { + $this->mOutput->setIndexPolicy( 'index' ); + } + return $text; } diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index f98d56418d..5f69af7576 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -23,7 +23,8 @@ class ParserOutput $mOutputHooks, # Hook tags as per $wgParserOutputHooks $mWarnings, # Warning text to be returned to the user. Wikitext formatted, in the key only $mSections, # Table of contents - $mProperties; # Name/value pairs to be cached in the DB + $mProperties, # Name/value pairs to be cached in the DB + $mIndexPolicy; # 'index' or 'noindex'? Default is null /** * Overridden title for display @@ -52,6 +53,7 @@ class ParserOutput $this->mOutputHooks = array(); $this->mWarnings = array(); $this->mProperties = array(); + $this->mIndexPolicy = null; } function getText() { return $this->mText; } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 2361b84b62..1ec6886532 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -340,6 +340,8 @@ $magicWords = array( 'hiddencat' => array( 1, '__HIDDENCAT__' ), 'pagesincategory' => array( 1, 'PAGESINCATEGORY', 'PAGESINCAT' ), 'pagesize' => array( 1, 'PAGESIZE' ), + 'index' => array( 1, '__INDEX__' ), + 'noindex' => array( 1, '__NOINDEX__' ), ); /**