When getting remote config, if the caller requested a single setting without an array...
authorAlex Monk <krenair@gmail.com>
Sat, 6 Sep 2014 21:42:02 +0000 (22:42 +0100)
committerAlex Monk <krenair@gmail.com>
Sat, 6 Sep 2014 21:44:07 +0000 (22:44 +0100)
Even if it comes from the cache. See Idfec62d5 review comments for PS43.

Change-Id: I67ceef7fec61b7f37728f120354bd886018d244e

includes/SiteConfiguration.php

index b877544..8c1f26b 100644 (file)
@@ -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'." );