diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-05-18 06:59:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-05-18 06:59:46 +0000 |
commit | 7d2d610f13f0a5abd09b2f7d678fb553d1934d40 (patch) | |
tree | f3ebadf2938a333b8fd9546e6637c7818c58fac3 /modules/simpletest/tests/common_test.module | |
parent | f8c58bf23d9c97182cfb7262ec0ab7ec66507cb8 (diff) | |
download | brdo-7d2d610f13f0a5abd09b2f7d678fb553d1934d40.tar.gz brdo-7d2d610f13f0a5abd09b2f7d678fb553d1934d40.tar.bz2 |
- Patch #796120 by c960657: do not urldecode() parameters in drupal_goto().
Diffstat (limited to 'modules/simpletest/tests/common_test.module')
-rw-r--r-- | modules/simpletest/tests/common_test.module | 30 |
1 files changed, 28 insertions, 2 deletions
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); } /** @@ -76,6 +94,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(). */ function common_test_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) { |