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(-)

Approvals:
  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( 
'/(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia|wikinews|wikiversity|wikivoyage|wikimediafoundation|mediawiki|wikidata)\.org/',
 $url ) ) {
+                               if ( preg_match( 
'/(?:\/\/|\.)(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia|' .
+                                       
'wikinews|wikiversity|wikivoyage|wikimediafoundation|mediawiki|wikidata)\.org/',
 $url )
+                               ) {
                                        $local = 1;
                                } else {
                                        $local = 0;

-- 
To view, visit https://gerrit.wikimedia.org/r/310207
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib23690c302e8033610fef9a0ef45345fe8a5803e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <bawolff...@gmail.com>
Gerrit-Reviewer: Brian Wolff <bawolff...@gmail.com>
Gerrit-Reviewer: TTO <at.li...@live.com.au>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to