Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -472,15 +472,23 @@ |
473 | 473 | * @param ParserOutput object &$parserOutput |
474 | 474 | */ |
475 | 475 | public function addParserOutputNoText( &$parserOutput ) { |
476 | | - global $wgAllowUserRobotsControl; |
| 476 | + global $wgTitle, $wgExemptFromUserRobotsControl, $wgContentNamespaces; |
477 | 477 | |
478 | 478 | $this->mLanguageLinks += $parserOutput->getLanguageLinks(); |
479 | 479 | $this->addCategoryLinks( $parserOutput->getCategories() ); |
480 | 480 | $this->mNewSectionLink = $parserOutput->getNewSection(); |
481 | | - if( $wgAllowUserRobotsControl ) { |
482 | | - # FIXME: This probably overrides $wgArticleRobotPolicies, is that wise? |
| 481 | + |
| 482 | + if( is_null( $wgExemptFromUserRobotsControl ) ) { |
| 483 | + $bannedNamespaces = $wgContentNamespaces; |
| 484 | + } else { |
| 485 | + $bannedNamespaces = $wgExemptFromUserRobotsControl; |
| 486 | + } |
| 487 | + if( !in_array( $wgTitle->getNamespace(), $bannedNamespaces ) ) { |
| 488 | + # FIXME (bug 14900): This overrides $wgArticleRobotPolicies, and it |
| 489 | + # shouldn't |
483 | 490 | $this->setIndexPolicy( $parserOutput->getIndexPolicy() ); |
484 | 491 | } |
| 492 | + |
485 | 493 | $this->addKeywords( $parserOutput ); |
486 | 494 | $this->mParseWarnings = $parserOutput->getWarnings(); |
487 | 495 | if ( $parserOutput->getCacheTime() == -1 ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2824,11 +2824,13 @@ |
2825 | 2825 | $wgArticleRobotPolicies = array(); |
2826 | 2826 | |
2827 | 2827 | /** |
2828 | | - * Set to true to allow the __INDEX__ and __NOINDEX__ magic words to function. |
2829 | | - * These will allow users to control whether any page they can edit is indexed |
2830 | | - * by search engines. |
| 2828 | + * An array of namespace keys in which the __INDEX__/__NOINDEX__ magic words |
| 2829 | + * will not function, so users can't decide whether pages in that namespace are |
| 2830 | + * indexed by search engines. If set to null, default to $wgContentNamespaces. |
| 2831 | + * Example: |
| 2832 | + * $wgExemptFromUserRobotsControl = array( NS_MAIN, NS_TALK, NS_PROJECT ); |
2831 | 2833 | */ |
2832 | | -$wgAllowUserRobotsControl = false; |
| 2834 | +$wgExemptFromUserRobotsControl = null; |
2833 | 2835 | |
2834 | 2836 | /** |
2835 | 2837 | * Specifies the minimal length of a user password. If set to |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -20,13 +20,14 @@ |
21 | 21 | |
22 | 22 | === Configuration changes in 1.14 === |
23 | 23 | |
24 | | -* (bug 8068) $wgAllowUserRobotsControl (false by default) can enable new |
25 | | - __INDEX__ and __NOINDEX__ magic words, which allow user control of search en- |
26 | | - gine indexing on a per-article basis. |
| 24 | +* $wgExemptFromUserRobotsControl is an array of namespaces to be exempt from |
| 25 | + the effect of the new __INDEX__/__NOINDEX__ magic words. (Default: null, ex- |
| 26 | + empt all content namespaces.) |
27 | 27 | |
28 | 28 | === New features in 1.14 === |
29 | 29 | |
30 | | -None yet |
| 30 | +* (bug 8068) New __INDEX__ and __NOINDEX__ magic words allow user control of |
| 31 | + search engine indexing on a per-article basis. |
31 | 32 | |
32 | 33 | === Bug fixes in 1.14 === |
33 | 34 | |