From 3cb2a5eff420a00a3579df5ed7950f8d5c761bce Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 14 Oct 2009 20:42:47 +0000 Subject: - Patch #582456 by dereine, sun, tobiasb: make confirm_form() respect query string destination. --- modules/system/system.module | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index b6c25134b..a4c1ff883 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2400,14 +2400,17 @@ function _system_sort_requirements($a, $b) { function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm') { $description = isset($description) ? $description : t('This action cannot be undone.'); - // Prepare cancel link - $query = $fragment = NULL; - if (is_array($path)) { - $query = isset($path['query']) ? $path['query'] : NULL; - $fragment = isset($path['fragment']) ? $path['fragment'] : NULL; - $path = isset($path['path']) ? $path['path'] : NULL; - } - $cancel = l($no ? $no : t('Cancel'), $path, array('query' => $query, 'fragment' => $fragment)); + // Prepare cancel link. + if (isset($_GET['destination'])) { + $options = drupal_parse_url(urldecode($_GET['destination'])); + } + elseif (is_array($path)) { + $options = $path; + } + else { + $options = array('path' => $path); + } + $cancel = l($no ? $no : t('Cancel'), $options['path'], $options); drupal_set_title($question, PASS_THROUGH); -- cgit v1.2.3