From 7d2d610f13f0a5abd09b2f7d678fb553d1934d40 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 18 May 2010 06:59:46 +0000 Subject: - Patch #796120 by c960657: do not urldecode() parameters in drupal_goto(). --- modules/simpletest/tests/common_test.module | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'modules/simpletest/tests/common_test.module') diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index a80f00f74..1b5dbc351 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -28,6 +28,12 @@ function common_test_menu() { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); + $items['common-test/drupal_goto/redirect_advanced'] = array( + 'title' => 'Drupal Goto', + 'page callback' => 'common_test_drupal_goto_redirect_advanced', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); $items['common-test/drupal_goto/redirect_fail'] = array( 'title' => 'Drupal Goto Failure', 'page callback' => 'drupal_goto', @@ -35,6 +41,12 @@ function common_test_menu() { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); + $items['common-test/destination'] = array( + 'title' => 'Drupal Get Destination', + 'page callback' => 'common_test_destination', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); $items['common-test/query-string'] = array( 'title' => 'Test querystring', 'page callback' => 'common_test_js_and_css_querystring', @@ -45,11 +57,17 @@ function common_test_menu() { } /** - * Check that drupal_goto() exits once called. + * Redirect using drupal_goto(). */ function common_test_drupal_goto_redirect() { drupal_goto('common-test/drupal_goto'); - print t("Drupal goto failed to stop program"); +} + +/** + * Redirect using drupal_goto(). + */ +function common_test_drupal_goto_redirect_advanced() { + drupal_goto('common-test/drupal_goto', array('query' => array('foo' => '123')), 301); } /** @@ -75,6 +93,14 @@ function common_test_drupal_goto_alter(&$path, &$options, &$http_response_code) } } +/** + * Print destination query parameter. + */ +function common_test_destination() { + $destination = drupal_get_destination(); + print "The destination: " . check_plain($destination['destination']); +} + /** * Implements hook_TYPE_alter(). */ -- cgit v1.2.3