$lines = array_map( 'trim', explode( "\n", trim( $intermap ) ) );
if ( !$lines || count( $lines ) < 2 ) {
- die( "m:Interwiki_map not found" );
+ wfDie( "m:Interwiki_map not found" );
}
$iwArray = array();
foreach ( $lines as $line ) {
- if ( preg_match( '/^\|\s*(.*?)\s*\|\|\s*(.*?)\s*$/', $line, $matches ) ) {
+ if ( preg_match( '/^\|\s*(.*?)\s*\|\|\s*(https?:\/\/.*?)\s*$/', $line, $matches ) ) {
$prefix = strtolower( $matches[1] );
$url = $matches[2];
- if ( preg_match( '/(wikipedia|wiktionary|wikisource|wikiquote|wikibooks)\.org/', $url ) ) {
+ if ( preg_match( '/(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia)\.org/', $url ) ) {
$local = 1;
} else {
$local = 0;