* Introduced LBFactory -- an abstract class for configuring database load balancers...
[lhc/web/wiklou.git] / includes / SiteConfiguration.php
index beeeaf1..d9629a0 100644 (file)
@@ -126,7 +126,11 @@ class SiteConfiguration {
                $site = NULL;
                $lang = NULL;
                foreach ( $this->suffixes as $suffix ) {
-                       if ( substr( $db, -strlen( $suffix ) ) == $suffix ) {
+                       if ( $suffix === '' ) {
+                               $site = '';
+                               $lang = $db;
+                               break;
+                       } elseif ( substr( $db, -strlen( $suffix ) ) == $suffix ) {
                                $site = $suffix == 'wiki' ? 'wikipedia' : $suffix;
                                $lang = substr( $db, 0, strlen( $db ) - strlen( $suffix ) );
                                break;