X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSiteConfiguration.php;h=cab98a7c63003deae11699275fb953f1cda4a3b4;hb=33415e2930b8e583fe81ec026608c0af523f7afe;hp=7af80dcfd6e3746042c537c19f5a1b87e42a0f69;hpb=65f12f7190442dcea96eb8d642ebbf8c39df1427;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 7af80dcfd6..cab98a7c63 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -562,7 +562,7 @@ class SiteConfiguration { ->execute(); $data = trim( $result->getStdout() ); - if ( $result->getExitCode() != 0 || !strlen( $data ) ) { + if ( $result->getExitCode() || $data === '' ) { throw new MWException( "Failed to run getConfiguration.php: {$result->getStdout()}" ); } $res = unserialize( $data ); @@ -582,14 +582,14 @@ class SiteConfiguration { * which is not fun * * @param array $array1 + * @param array ...$arrays * * @return array */ - static function arrayMerge( $array1/* ... */ ) { + static function arrayMerge( array $array1, ...$arrays ) { $out = $array1; - $argsCount = func_num_args(); - for ( $i = 1; $i < $argsCount; $i++ ) { - foreach ( func_get_arg( $i ) as $key => $value ) { + foreach ( $arrays as $array ) { + foreach ( $array as $key => $value ) { if ( isset( $out[$key] ) && is_array( $out[$key] ) && is_array( $value ) ) { $out[$key] = self::arrayMerge( $out[$key], $value ); } elseif ( !isset( $out[$key] ) || !$out[$key] && !is_numeric( $key ) ) {