From b8731482c97be4c42a10d4259d0969229f7ec4dc Mon Sep 17 00:00:00 2001 From: Nathan Phillip Brink Date: Tue, 26 Jun 2012 06:23:11 +0000 Subject: [PATCH] Issue #1356170 by tim.plunkett: Remove all uses of array_merge_recursive, or document why they are being used instead of drupal_array_merge_deep. --- core/includes/ajax.inc | 2 +- core/includes/module.inc | 2 +- core/modules/file/file.module | 2 +- core/modules/node/node.pages.inc | 2 +- core/modules/system/system.module | 2 +- core/modules/translation/translation.pages.inc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index ede35da..c286d9c 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -292,7 +292,7 @@ function ajax_render($commands = array()) { $scripts = drupal_add_js(); if (!empty($scripts['settings'])) { $settings = $scripts['settings']; - array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE)); + array_unshift($commands, ajax_command_settings(drupal_array_merge_deep_array($settings['data']), TRUE)); } // Allow modules to alter any Ajax response. diff --git a/core/includes/module.inc b/core/includes/module.inc index a71cb18..6d4e99b 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -782,7 +782,7 @@ function module_hook_info() { if (function_exists($function)) { $result = $function(); if (isset($result) && is_array($result)) { - $hook_info = array_merge_recursive($hook_info, $result); + $hook_info = drupal_array_merge_deep($hook_info, $result); } } } diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 6541e8d..f4403c5 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -283,7 +283,7 @@ function file_ajax_upload() { $output = theme('status_messages') . drupal_render($form); $js = drupal_add_js(); - $settings = call_user_func_array('array_merge_recursive', $js['settings']['data']); + $settings = drupal_array_merge_deep_array($js['settings']['data']); $commands = array(); $commands[] = ajax_command_replace(NULL, $output, $settings); diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index faa3dea..725df98 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -176,7 +176,7 @@ function node_form($form, &$form_state, Node $node) { // handlers to the form buttons below. Remove hook_form() entirely. $function = node_type_get_base($node) . '_form'; if (function_exists($function) && ($extra = $function($node, $form_state))) { - $form = array_merge_recursive($form, $extra); + $form = drupal_array_merge_deep($form, $extra); } // If the node type has a title, and the node type form defined no special // weight for it, we default to a weight of -5 for consistency. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index b32187a..76a74fe 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -4002,7 +4002,7 @@ function _system_date_formats_build() { // If another module already set this format, merge in the new settings. if (isset($date_formats[$module_format['type']][$module_format['format']])) { - $date_formats[$module_format['type']][$module_format['format']] = array_merge_recursive($date_formats[$module_format['type']][$module_format['format']], $module_format); + $date_formats[$module_format['type']][$module_format['format']] = drupal_array_merge_deep($date_formats[$module_format['type']][$module_format['format']], $module_format); } else { // This setting will be overridden later if it already exists in the db. diff --git a/core/modules/translation/translation.pages.inc b/core/modules/translation/translation.pages.inc index a6e8b3c..bd150ef 100644 --- a/core/modules/translation/translation.pages.inc +++ b/core/modules/translation/translation.pages.inc @@ -65,7 +65,7 @@ function translation_node_overview(Node $node) { $path = 'node/add/' . $node->type; $links = language_negotiation_get_switch_links($type, $path); $query = array('query' => array('translation' => $node->nid, 'target' => $langcode)); - $options[] = empty($links->links[$langcode]['href']) ? l($text, $path, $query) : l($text, $links->links[$langcode]['href'], array_merge_recursive($links->links[$langcode], $query)); + $options[] = empty($links->links[$langcode]['href']) ? l($text, $path, $query) : l($text, $links->links[$langcode]['href'], drupal_array_merge_deep($links->links[$langcode], $query)); } $status = t('Not translated'); } -- 1.7.3.4