Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -74,7 +74,6 @@ |
75 | 75 | |
76 | 76 | function addCategory( $c, $sort ) { $this->mCategories[$c] = $sort; } |
77 | 77 | function addLanguageLink( $t ) { $this->mLanguageLinks[] = $t; } |
78 | | - function addExternalLink( $url ) { $this->mExternalLinks[$url] = 1; } |
79 | 78 | function addWarning( $s ) { $this->mWarnings[$s] = 1; } |
80 | 79 | |
81 | 80 | function addOutputHook( $hook, $data = false ) { |
— | — | @@ -94,6 +93,13 @@ |
95 | 94 | return (bool)$this->mNewSection; |
96 | 95 | } |
97 | 96 | |
| 97 | + function addExternalLink( $url ) { |
| 98 | + # We don't register links pointing to our own server, unless... :-) |
| 99 | + global $wgServer, $wgRegisterInternalExternals; |
| 100 | + if( $wgRegisterInternalExternals or stripos($url,$wgServer)!==0) |
| 101 | + $this->mExternalLinks[$url] = 1; |
| 102 | + } |
| 103 | + |
98 | 104 | function addLink( $title, $id = null ) { |
99 | 105 | $ns = $title->getNamespace(); |
100 | 106 | $dbk = $title->getDBkey(); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3753,6 +3753,12 @@ |
3754 | 3754 | $wgLinkHolderBatchSize = 1000; |
3755 | 3755 | |
3756 | 3756 | /** |
| 3757 | + * By default MediaWiki does not register links pointing to same server in externallinks dataset, |
| 3758 | + * use this value to override: |
| 3759 | + */ |
| 3760 | +$wgRegisterInternalExternals = false; |
| 3761 | + |
| 3762 | +/** |
3757 | 3763 | * Hooks that are used for outputting exceptions. Format is: |
3758 | 3764 | * $wgExceptionHooks[] = $funcname |
3759 | 3765 | * or: |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -52,6 +52,8 @@ |
53 | 53 | functionality is now available via $wgLocalisationCacheConf. |
54 | 54 | * $wgMessageCache->addMessages() is deprecated. Messages added via this |
55 | 55 | interface will not appear in Special:AllMessages. |
| 56 | +* $wgRegisterInternalExternals can be used to record external links pointing |
| 57 | + to same server |
56 | 58 | |
57 | 59 | === New features in 1.16 === |
58 | 60 | |
— | — | @@ -238,6 +240,7 @@ |
239 | 241 | * (bug 19468) Enotif preferences are now only displayed when they are turned on |
240 | 242 | * (bug 19442) Show/hide options on watchlist only work once |
241 | 243 | * (bug 19602) PubMed Magic links now use updated NIH url |
| 244 | +* (bug 19637) externallinks have links to self |
242 | 245 | |
243 | 246 | == API changes in 1.16 == |
244 | 247 | |