Also replace some odd hardcoded robot policies (for Special:Specialpages and for nonexistent images) with 'noindex,nofollow', which seems more
appropriate at least for the latter. I'm not quite sure _why_ Special:Specialpages was marked as 'index,nofollow' before; it's been that way since
r1284. It might be safe to just leave it at the default setting, but I don't really think it makes much difference either way.
* (bug 10365) Localization of Special:Version
* When installing using Postgres, the Pl/Pgsql language is now checked for
and installed when at the superuser level.
+* The default robot policy for the entire wiki is now configurable via the
+ $wgDefaultRobotPolicy setting.
=== Bug fixes in 1.12 ===
global $wgUser, $wgOut, $wgRequest, $wgContLang;
global $wgEnableParserCache, $wgStylePath, $wgParser;
global $wgUseTrackbacks, $wgNamespaceRobotPolicies, $wgArticleRobotPolicies;
+ global $wgDefaultRobotPolicy;
$sk = $wgUser->getSkin();
wfProfileIn( __METHOD__ );
# Honour customised robot policies for this namespace
$policy = $wgNamespaceRobotPolicies[$ns];
} else {
- # Default to encourage indexing and following links
- $policy = 'index,follow';
+ $policy = $wgDefaultRobotPolicy;
}
$wgOut->setRobotPolicy( $policy );
*/
$wgNoFollowNsExceptions = array();
+/**
+ * Default robot policy.
+ * The default policy is to encourage indexing and following of links.
+ * It may be overridden on a per-namespace and/or per-page basis.
+ */
+$wgDefaultRobotPolicy = 'index,follow';
+
/**
* Robot policies per namespaces.
- * The default policy is 'index,follow', the array is made of namespace
+ * The default policy is given above, the array is made of namespace
* constants as defined in includes/Defines.php
* Example:
* $wgNamespaceRobotPolicies = array( NS_TALK => 'noindex' );
} else {
# Just need to set the right headers
$wgOut->setArticleFlag( true );
- $wgOut->setRobotpolicy( 'index,follow' );
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
$this->viewUpdates();
}
$wgMessageCache->loadAllMessages();
- $wgOut->setRobotpolicy( 'index,nofollow' );
+ $wgOut->setRobotpolicy( 'noindex,nofollow' ); # Is this really needed?
$sk = $wgUser->getSkin();
/** Pages available to all */