| Index: trunk/phase3/includes/Linker.php |
| — | — | @@ -734,10 +734,10 @@ |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | /** @todo document */ |
| 738 | | - function makeExternalLink( $url, $text, $escape = true, $linktype = '' ) { |
| | 738 | + function makeExternalLink( $url, $text, $escape = true, $linktype = '', $ns = null ) { |
| 739 | 739 | $style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype ); |
| 740 | | - global $wgNoFollowLinks; |
| 741 | | - if( $wgNoFollowLinks ) { |
| | 740 | + global $wgNoFollowLinks, $wgNoFollowNsExceptions; |
| | 741 | + if( $wgNoFollowLinks && !(isset($ns) && in_array($ns, $wgNoFollowNsExceptions)) ) { |
| 742 | 742 | $style .= ' rel="nofollow"'; |
| 743 | 743 | } |
| 744 | 744 | $url = htmlspecialchars( $url ); |
| Index: trunk/phase3/includes/Parser.php |
| — | — | @@ -1190,7 +1190,7 @@ |
| 1191 | 1191 | # This means that users can paste URLs directly into the text |
| 1192 | 1192 | # Funny characters like ö aren't valid in URLs anyway |
| 1193 | 1193 | # This was changed in August 2004 |
| 1194 | | - $s .= $sk->makeExternalLink( $url, $text, false, $linktype ) . $dtrail . $trail; |
| | 1194 | + $s .= $sk->makeExternalLink( $url, $text, false, $linktype, $this->mTitle->getNamespace() ) . $dtrail . $trail; |
| 1195 | 1195 | |
| 1196 | 1196 | # Register link in the output object. |
| 1197 | 1197 | # Replace unnecessary URL escape codes with the referenced character |
| — | — | @@ -1270,7 +1270,7 @@ |
| 1271 | 1271 | $text = $this->maybeMakeExternalImage( $url ); |
| 1272 | 1272 | if ( $text === false ) { |
| 1273 | 1273 | # Not an image, make a link |
| 1274 | | - $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free' ); |
| | 1274 | + $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free', $this->mTitle->getNamespace() ); |
| 1275 | 1275 | # Register it in the output object... |
| 1276 | 1276 | # Replace unnecessary URL escape codes with their equivalent characters |
| 1277 | 1277 | $pasteurized = Parser::replaceUnusualEscapes( $url ); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -1747,6 +1747,12 @@ |
| 1748 | 1748 | $wgNoFollowLinks = true; |
| 1749 | 1749 | |
| 1750 | 1750 | /** |
| | 1751 | + * Namespaces in which $wgNoFollowLinks doesn't apply. |
| | 1752 | + * See Language.php for a list of namespaces. |
| | 1753 | + */ |
| | 1754 | +$wgNoFollowNsExceptions = array(); |
| | 1755 | + |
| | 1756 | +/** |
| 1751 | 1757 | * Specifies the minimal length of a user password. If set to |
| 1752 | 1758 | * 0, empty passwords are allowed. |
| 1753 | 1759 | */ |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -313,7 +313,10 @@ |
| 314 | 314 | look garbled when tidy isn't on |
| 315 | 315 | * (bug 5511) Fix URL-encoding of usernames in links on Special:Ipblocklist |
| 316 | 316 | * (bug 6046) Update to Indonesian localisation (id) #15 |
| | 317 | +* (bug 5523) $wgNoFollowNsExceptions to allow disabling rel="nofollow" in |
| | 318 | + specially-selected namespaces. |
| 317 | 319 | |
| | 320 | + |
| 318 | 321 | == Compatibility == |
| 319 | 322 | |
| 320 | 323 | Older PHP 4.2 and 4.1 releases are no longer supported; PHP 4 users must |