Patch by Ilmari Karonen, http://bugzilla.wikimedia.org/attachment.cgi?id=1789&action=view
look garbled when tidy isn't on
* (bug 5511) Fix URL-encoding of usernames in links on Special:Ipblocklist
* (bug 6046) Update to Indonesian localisation (id) #15
+* (bug 5523) $wgNoFollowNsExceptions to allow disabling rel="nofollow" in
+ specially-selected namespaces.
+
== Compatibility ==
*/
$wgNoFollowLinks = true;
+/**
+ * Namespaces in which $wgNoFollowLinks doesn't apply.
+ * See Language.php for a list of namespaces.
+ */
+$wgNoFollowNsExceptions = array();
+
/**
* Specifies the minimal length of a user password. If set to
* 0, empty passwords are allowed.
}
/** @todo document */
- function makeExternalLink( $url, $text, $escape = true, $linktype = '' ) {
+ function makeExternalLink( $url, $text, $escape = true, $linktype = '', $ns = null ) {
$style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype );
- global $wgNoFollowLinks;
- if( $wgNoFollowLinks ) {
+ global $wgNoFollowLinks, $wgNoFollowNsExceptions;
+ if( $wgNoFollowLinks && !(isset($ns) && in_array($ns, $wgNoFollowNsExceptions)) ) {
$style .= ' rel="nofollow"';
}
$url = htmlspecialchars( $url );
# This means that users can paste URLs directly into the text
# Funny characters like ö aren't valid in URLs anyway
# This was changed in August 2004
- $s .= $sk->makeExternalLink( $url, $text, false, $linktype ) . $dtrail . $trail;
+ $s .= $sk->makeExternalLink( $url, $text, false, $linktype, $this->mTitle->getNamespace() ) . $dtrail . $trail;
# Register link in the output object.
# Replace unnecessary URL escape codes with the referenced character
$text = $this->maybeMakeExternalImage( $url );
if ( $text === false ) {
# Not an image, make a link
- $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free' );
+ $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free', $this->mTitle->getNamespace() );
# Register it in the output object...
# Replace unnecessary URL escape codes with their equivalent characters
$pasteurized = Parser::replaceUnusualEscapes( $url );