From: Alex Monk Date: Sat, 6 Sep 2014 21:42:02 +0000 (+0100) Subject: When getting remote config, if the caller requested a single setting without an array... X-Git-Tag: 1.31.0-rc.0~14113^2 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=1a257876998a9066241264ffeeaa579cea3abee6;p=lhc%2Fweb%2Fwiklou.git When getting remote config, if the caller requested a single setting without an array, always do that Even if it comes from the cache. See Idfec62d5 review comments for PS43. Change-Id: I67ceef7fec61b7f37728f120354bd886018d244e --- diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index b877544099..8c1f26b82a 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -532,7 +532,7 @@ class SiteConfiguration { if ( isset( $this->cfgCache[$wiki] ) ) { $res = array_intersect_key( $this->cfgCache[$wiki], array_flip( $settings ) ); if ( count( $res ) == count( $settings ) ) { - return $res; // cache hit + return $multi ? $res : current( $res ); // cache hit } } elseif ( !in_array( $wiki, $this->wikis ) ) { throw new MWException( "No such wiki '$wiki'." );