From 9cdf419be56d3568254ee9a3e7210f9ff096cca6 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 16 Jun 2015 16:08:44 -0700 Subject: [PATCH] registration: Improve error message if a non-array attribute is set Otherwise array_merge_recursive() will trigger a confusing and unhelpful warning. Bug: T102523 Change-Id: I7e4778cb7552fe93a08f315c9888ec64322e2501 --- includes/registration/ExtensionProcessor.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 0a09ff5a42..273e9ef0ba 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -290,10 +290,14 @@ class ExtensionProcessor implements Processor { /** * @param string $name - * @param mixed $value + * @param array $value * @param array &$array + * @throws InvalidArgumentException */ protected function storeToArray( $name, $value, &$array ) { + if ( !is_array( $value ) ) { + throw new InvalidArgumentException( "The value for '$name' should be an array" ); + } if ( isset( $array[$name] ) ) { $array[$name] = array_merge_recursive( $array[$name], $value ); } else { -- 2.20.1