diff --git a/core/includes/batch.inc b/core/includes/batch.inc index f87f9fa..2a51fb5 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -14,7 +14,8 @@ * @see batch_get() */ -use \Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\RedirectResponse; /** * Loads a batch from the database. diff --git a/core/includes/common.inc b/core/includes/common.inc index b9abf40..6ecf2eb 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -527,7 +527,7 @@ function drupal_http_build_query(array $query, $parent = '') { * not available, the current path. * * @see current_path() - * @see RedirectResponse + * @see \Symfony\Component\HttpFoundation\RedirectResponse */ function drupal_get_destination() { $destination = &drupal_static(__FUNCTION__); @@ -581,7 +581,6 @@ function drupal_get_destination() { * - 'fragment': The fragment of $url, if existent. * * @see url() - * @see RedirectResponse() * @ingroup php_wrappers */ function drupal_parse_url($url) { diff --git a/core/includes/form.inc b/core/includes/form.inc index 160c0d4..9def7fb 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -1275,7 +1275,8 @@ function drupal_redirect_form($form_state) { if (!isset($form_state['redirect']) || $form_state['redirect'] !== FALSE) { if (isset($form_state['redirect'])) { if (is_array($form_state['redirect'])) { - return new RedirectResponse(array_pop($form_state['redirect']), 302); + $url = call_user_func_array('url', $form_state['redirect']); + return new RedirectResponse($url, 302); } else { // This function can be called from the installer, which guarantees @@ -4969,12 +4970,12 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU $_SESSION['batches'][$batch['id']] = TRUE; // Redirect for processing. - $redirect_options = array('query' => array('op' => 'start', 'id' => $batch['id'])); + $options = array('query' => array('op' => 'start', 'id' => $batch['id'])); if (($function = $batch['redirect_callback']) && function_exists($function)) { - $function($batch['url'], $redirect_options); + $function($batch['url'], $options); } else { - return new RedirectResponse($batch['url'], 302, $redirect_options); + return new RedirectResponse(url($batch['url'], $options), 302); } } else { diff --git a/core/modules/openid/openid.module b/core/modules/openid/openid.module index 57a737b..c7ea34d 100644 --- a/core/modules/openid/openid.module +++ b/core/modules/openid/openid.module @@ -809,7 +809,7 @@ function openid_authentication($response) { // registration page and prefill with the values we received. $destination = drupal_get_destination(); unset($_GET['destination']); - return new RedirectResponse('user/register', array('query' => $destination)); + return new RedirectResponse(url('user/register', array('query' => $destination))); } else { drupal_set_message(t('Only site administrators can create new user accounts.'), 'error'); diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 38c3c38..32dc04c 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -136,7 +136,7 @@ function overlay_init() { // #overlay=admin/modules to actually enable the overlay. if (isset($_SESSION['overlay_enable_redirect']) && $_SESSION['overlay_enable_redirect']) { unset($_SESSION['overlay_enable_redirect']); - return new RedirectResponse('', array('fragment' => 'overlay=' . $current_path)); + return new RedirectResponse(url('', array('fragment' => 'overlay=' . $current_path))); } if (isset($_GET['render']) && $_GET['render'] == 'overlay') { diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 7dcbebb..a72355d 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2180,7 +2180,7 @@ function _system_themes_access($theme) { * not to assume any code exists. Example (system_authorized_run()): * @code * system_authorized_init($callback, $file, $arguments, $page_title); - * drupal_goto(system_authorized_get_url()); + * return new RedirectResponse(system_authorized_get_url()); * @endcode * Example (update_manager_install_form_submit()): * @code