jenkins-bot has submitted this change and it was merged.

Change subject: Make sure only WMF/Chapter interwikis are internal

Make sure only WMF/Chapter interwikis are internal

This prevents certain non-Wikimedia sites, like semantic
mediawiki from having the internal (forward) flag. This
prevents automatic redirection to those domains. This helps
maintain user privacy and prevent phishing attacks, in case
one of those domains went evil. It also makes which domains
get the internal bit be consistent.

Patch based on TTO's patch from T142071 with mild modification
of anchors used.

For now, this still leaves chapters as being internal, as its
more controversial if they should be. Further discussion on
that can happen on the bug.

Bug: T142071
Change-Id: Ib23690c302e8033610fef9a0ef45345fe8a5803e
M dumpInterwiki.php
1 file changed, 3 insertions(+), 1 deletion(-)

  TTO: Looks good to me, approved
  jenkins-bot: Verified

diff --git a/dumpInterwiki.php b/dumpInterwiki.php
index d0b41a4..d8a7c8c 100644
--- a/dumpInterwiki.php
+++ b/dumpInterwiki.php
@@ -297,7 +297,9 @@
                                $prefix = str_replace( ' ', '_', $prefix );
                                $url = $matches[2];
-                               if ( preg_match( 
 $url ) ) {
+                               if ( preg_match( 
'/(?:\/\/|\.)(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia|' .
 $url )
+                               ) {
                                        $local = 1;
                                } else {
                                        $local = 0;

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib23690c302e8033610fef9a0ef45345fe8a5803e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <>
Gerrit-Reviewer: Brian Wolff <>
Gerrit-Reviewer: TTO <>
Gerrit-Reviewer: jenkins-bot <>

MediaWiki-commits mailing list

Reply via email to