And one error suppression opertator less (per bug 24159)
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 2 Jul 2010 19:10:36 +0000 (19:10 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 2 Jul 2010 19:10:36 +0000 (19:10 +0000)
includes/ExternalStore.php

index 6a77907..ddb40c3 100644 (file)
@@ -32,10 +32,17 @@ class ExternalStore {
                if( !$wgExternalStores )
                        return false;
 
-               @list( $proto, $path ) = explode( '://', $url, 2 );
-               /* Bad URL */
-               if( $path == '' )
+               $parts = explode( '://', $url, 2 );
+
+               if ( count( $parts ) != 2 ) {
+                       return false;
+               }
+
+               list( $proto, $path ) = $parts;
+
+               if ( $path == '' ) { // Bad URL
                        return false;
+               }
 
                $store = self::getStoreObject( $proto, $params );
                if ( $store === false )