From 370e83bb0dfd0c70de268c93bf07ad5ee0897192 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 15 Aug 2008 01:29:47 +0200 Subject: Update auf 1.13.0 --- includes/SiteConfiguration.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes/SiteConfiguration.php') diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index beeeaf15..6cdd5082 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -54,7 +54,7 @@ class SiteConfiguration { } return $retval; } - + /** Type-safe string replace; won't do replacements on non-strings */ function doReplace( $from, $to, $in ) { if( is_string( $in ) ) { @@ -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; @@ -142,5 +146,3 @@ class SiteConfiguration { } } } - - -- cgit v1.2.3-54-g00ecf