* (bug 5161) Don't try to load template list for nonexistent pages
[lhc/web/wiklou.git] / maintenance / rebuildInterwiki.inc
index d2c2297..fea5f64 100644 (file)
@@ -102,16 +102,16 @@ function getRebuildInterwikiSQL() {
        $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;