r53104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53103‎ | r53104 | r53105 >
Date:08:04, 11 July 2009
Author:midom
Status:resolved
Tags:
Comment:
Fix Bug#19637 - self-referencing externals will be by default filtered out
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -74,7 +74,6 @@
7575
7676 function addCategory( $c, $sort ) { $this->mCategories[$c] = $sort; }
7777 function addLanguageLink( $t ) { $this->mLanguageLinks[] = $t; }
78 - function addExternalLink( $url ) { $this->mExternalLinks[$url] = 1; }
7978 function addWarning( $s ) { $this->mWarnings[$s] = 1; }
8079
8180 function addOutputHook( $hook, $data = false ) {
@@ -94,6 +93,13 @@
9594 return (bool)$this->mNewSection;
9695 }
9796
 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+
98104 function addLink( $title, $id = null ) {
99105 $ns = $title->getNamespace();
100106 $dbk = $title->getDBkey();
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3753,6 +3753,12 @@
37543754 $wgLinkHolderBatchSize = 1000;
37553755
37563756 /**
 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+/**
37573763 * Hooks that are used for outputting exceptions. Format is:
37583764 * $wgExceptionHooks[] = $funcname
37593765 * or:
Index: trunk/phase3/RELEASE-NOTES
@@ -52,6 +52,8 @@
5353 functionality is now available via $wgLocalisationCacheConf.
5454 * $wgMessageCache->addMessages() is deprecated. Messages added via this
5555 interface will not appear in Special:AllMessages.
 56+* $wgRegisterInternalExternals can be used to record external links pointing
 57+ to same server
5658
5759 === New features in 1.16 ===
5860
@@ -238,6 +240,7 @@
239241 * (bug 19468) Enotif preferences are now only displayed when they are turned on
240242 * (bug 19442) Show/hide options on watchlist only work once
241243 * (bug 19602) PubMed Magic links now use updated NIH url
 244+* (bug 19637) externallinks have links to self
242245
243246 == API changes in 1.16 ==
244247

Status & tagging log