X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSiteConfiguration.php;h=7af80dcfd6e3746042c537c19f5a1b87e42a0f69;hb=d87022e544995507f0791f0fee77a48d4e182109;hp=af65e457a5cde2f83cd3e0bb6e883bed9887d26d;hpb=d8d274aa3581000c2dc1b6c2fae823caff6f62d0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index af65e457a5..7af80dcfd6 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -483,13 +483,13 @@ class SiteConfiguration { /** * Work out the site and language name from a database name - * @param string $db + * @param string $wiki Wiki ID * * @return array */ - public function siteFromDB( $db ) { + public function siteFromDB( $wiki ) { // Allow override - $def = $this->getWikiParams( $db ); + $def = $this->getWikiParams( $wiki ); if ( !is_null( $def['suffix'] ) && !is_null( $def['lang'] ) ) { return [ $def['suffix'], $def['lang'] ]; } @@ -499,15 +499,16 @@ class SiteConfiguration { foreach ( $this->suffixes as $altSite => $suffix ) { if ( $suffix === '' ) { $site = ''; - $lang = $db; + $lang = $wiki; break; - } elseif ( substr( $db, -strlen( $suffix ) ) == $suffix ) { + } elseif ( substr( $wiki, -strlen( $suffix ) ) == $suffix ) { $site = is_numeric( $altSite ) ? $suffix : $altSite; - $lang = substr( $db, 0, strlen( $db ) - strlen( $suffix ) ); + $lang = substr( $wiki, 0, strlen( $wiki ) - strlen( $suffix ) ); break; } } $lang = str_replace( '_', '-', $lang ); + return [ $site, $lang ]; }