summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2009-10-14 20:42:47 (GMT)
committerDries Buytaert2009-10-14 20:42:47 (GMT)
commit3cb2a5eff420a00a3579df5ed7950f8d5c761bce (patch)
treed902867a1551637e730fe8c054382e9bffe84c1e
parent361359527594f0d1fae88d9f02cab7e07b030956 (diff)
- Patch #582456 by dereine, sun, tobiasb: make confirm_form() respect query string destination.
-rw-r--r--modules/node/node.pages.inc2
-rw-r--r--modules/path/path.admin.inc2
-rw-r--r--modules/system/system.module19
3 files changed, 13 insertions, 10 deletions
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 276a2dd..adb5f2d 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -462,7 +462,7 @@ function node_delete_confirm($form, &$form_state, $node) {
return confirm_form($form,
t('Are you sure you want to delete %title?', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])),
- isset($_GET['destination']) ? $_GET['destination'] : 'node/' . $node->nid,
+ 'node/' . $node->nid,
t('This action cannot be undone.'),
t('Delete'),
t('Cancel')
diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc
index 8cd3b1c..67d7915 100644
--- a/modules/path/path.admin.inc
+++ b/modules/path/path.admin.inc
@@ -186,7 +186,7 @@ function path_admin_delete_confirm($form, $form_state, $pid) {
$form['pid'] = array('#type' => 'value', '#value' => $pid);
$output = confirm_form($form,
t('Are you sure you want to delete path alias %title?', array('%title' => $path['dst'])),
- isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/path');
+ 'admin/config/search/path');
}
return $output;
}
diff --git a/modules/system/system.module b/modules/system/system.module
index b6c2513..a4c1ff8 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);