Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.989 diff -u -p -r1.989 common.inc --- includes/common.inc 15 Sep 2009 17:10:38 -0000 1.989 +++ includes/common.inc 15 Sep 2009 23:21:31 -0000 @@ -365,7 +365,7 @@ function drupal_query_string_encode($que */ function drupal_get_destination() { if (isset($_REQUEST['destination'])) { - return 'destination=' . urlencode($_REQUEST['destination']); + return array('destination' => $_REQUEST['destination']); } else { // Use $_GET here to retrieve the original path in source form. @@ -374,7 +374,7 @@ function drupal_get_destination() { if ($query != '') { $path .= '?' . $query; } - return 'destination=' . urlencode($path); + return array('destination' => $path); } } @@ -2176,7 +2176,7 @@ function url($path = NULL, array $option // Merge in defaults. $options += array( 'fragment' => '', - 'query' => '', + 'query' => array(), 'absolute' => FALSE, 'alias' => FALSE, 'https' => FALSE, @@ -2197,9 +2197,7 @@ function url($path = NULL, array $option if ($options['fragment']) { $options['fragment'] = '#' . $options['fragment']; } - if (is_array($options['query'])) { - $options['query'] = drupal_query_string_encode($options['query']); - } + $options['query'] = drupal_query_string_encode($options['query']); if ($options['external']) { // Split off the fragment. @@ -2275,15 +2273,15 @@ function url($path = NULL, array $option } else { // Without Clean URLs. - $variables = array(); + $query = array(); if (!empty($path)) { - $variables[] = 'q=' . $path; + $query[] = 'q=' . $path; } if (!empty($options['query'])) { - $variables[] = $options['query']; + $query[] = $options['query']; } - if ($query = join('&', $variables)) { - return $base . $script . '?' . $query . $options['fragment']; + if ($query) { + return $base . $script . '?' . implode('&', $query) . $options['fragment']; } else { return $base . $options['fragment']; Index: includes/pager.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/pager.inc,v retrieving revision 1.71 diff -u -p -r1.71 pager.inc --- includes/pager.inc 26 Aug 2009 04:58:23 -0000 1.71 +++ includes/pager.inc 15 Sep 2009 23:22:11 -0000 @@ -561,7 +561,7 @@ function theme_pager_link($text, $page_n } } - return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => count($query) ? implode('&', $query) : NULL)); + return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => $query)); } /** Index: includes/tablesort.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/tablesort.inc,v retrieving revision 1.53 diff -u -p -r1.53 tablesort.inc --- includes/tablesort.inc 26 Aug 2009 04:58:23 -0000 1.53 +++ includes/tablesort.inc 15 Sep 2009 23:23:54 -0000 @@ -205,11 +205,8 @@ function tablesort_header($cell, $header $ts['sort'] = 'asc'; $image = ''; } - - if (!empty($ts['query_string'])) { - $ts['query_string'] = '&' . $ts['query_string']; - } - $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => 'sort=' . $ts['sort'] . '&order=' . urlencode($cell['data']) . $ts['query_string'], 'html' => TRUE)); + // @todo $ts['query_string']... + $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array('sort' => $ts['sort'], 'order' => $cell['data'], $ts['query_string']), 'html' => TRUE)); unset($cell['field'], $cell['sort']); } Index: modules/aggregator/aggregator.test =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v retrieving revision 1.31 diff -u -p -r1.31 aggregator.test --- modules/aggregator/aggregator.test 24 Aug 2009 17:11:42 -0000 1.31 +++ modules/aggregator/aggregator.test 15 Sep 2009 23:25:47 -0000 @@ -56,7 +56,7 @@ class AggregatorTestCase extends DrupalW $feed_name = $this->randomName(10); if (!$feed_url) { $feed_url = url('rss.xml', array( - 'query' => 'feed=' . $feed_name, + 'query' => array('feed' => $feed_name), 'absolute' => TRUE, )); } Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.513 diff -u -p -r1.513 book.module --- modules/book/book.module 10 Sep 2009 12:33:43 -0000 1.513 +++ modules/book/book.module 15 Sep 2009 23:26:19 -0000 @@ -73,7 +73,7 @@ function book_node_view_link($node, $bui $links['book_add_child'] = array( 'title' => t('Add child page'), 'href' => 'node/add/' . str_replace('_', '-', $child_type), - 'query' => 'parent=' . $node->book['mlid'], + 'query' => array('parent' => $node->book['mlid']), ); } Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.769 diff -u -p -r1.769 comment.module --- modules/comment/comment.module 11 Sep 2009 13:37:52 -0000 1.769 +++ modules/comment/comment.module 15 Sep 2009 23:27:25 -0000 @@ -445,7 +445,7 @@ function comment_new_page_count($num_com } if ($pageno >= 1) { - $pagenum = "page=" . intval($pageno); + $pagenum = array('page' => intval($pageno)); } return $pagenum; Index: modules/comment/comment.test =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v retrieving revision 1.44 diff -u -p -r1.44 comment.test --- modules/comment/comment.test 21 Aug 2009 14:27:44 -0000 1.44 +++ modules/comment/comment.test 15 Sep 2009 23:29:26 -0000 @@ -308,7 +308,7 @@ class CommentInterfaceTest extends Comme $this->setCommentsPerPage(2); $comment_new_page = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE); $this->assertTrue($this->commentExists($comment_new_page), t('Page one exists. %s')); - $this->drupalGet('node/' . $this->node->nid, array('query' => 'page=1')); + $this->drupalGet('node/' . $this->node->nid, array('query' => array('page' => 1))); $this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s')); $this->setCommentsPerPage(50); @@ -588,13 +588,13 @@ class CommentPagerTest extends CommentHe $this->assertFalse($this->commentExists($comments[2]), t('Comment 3 does not appear on page 1.')); // Check the second page. - $this->drupalGet('node/' . $node->nid, array('query' => 'page=1')); + $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 1))); $this->assertTrue($this->commentExists($comments[1]), t('Comment 2 appears on page 2.')); $this->assertFalse($this->commentExists($comments[0]), t('Comment 1 does not appear on page 2.')); $this->assertFalse($this->commentExists($comments[2]), t('Comment 3 does not appear on page 2.')); // Check the third page. - $this->drupalGet('node/' . $node->nid, array('query' => 'page=2')); + $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 2))); $this->assertTrue($this->commentExists($comments[2]), t('Comment 3 appears on page 3.')); $this->assertFalse($this->commentExists($comments[0]), t('Comment 1 does not appear on page 3.')); $this->assertFalse($this->commentExists($comments[1]), t('Comment 2 does not appear on page 3.')); @@ -608,21 +608,21 @@ class CommentPagerTest extends CommentHe $this->setCommentsPerPage(2); // We are still in flat view - the replies should not be on the first page, // even though they are replies to the oldest comment. - $this->drupalGet('node/' . $node->nid, array('query' => 'page=0')); + $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0))); $this->assertFalse($this->commentExists($reply, TRUE), t('In flat mode, reply does not appear on page 1.')); // If we switch to threaded mode, the replies on the oldest comment // should be bumped to the first page and comment 6 should be bumped // to the second page. $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Switched to threaded mode.')); - $this->drupalGet('node/' . $node->nid, array('query' => 'page=0')); + $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0))); $this->assertTrue($this->commentExists($reply, TRUE), t('In threaded mode, reply appears on page 1.')); $this->assertFalse($this->commentExists($comments[1]), t('In threaded mode, comment 2 has been bumped off of page 1.')); // If (# replies > # comments per page) in threaded expanded view, // the overage should be bumped. $reply2 = $this->postComment(NULL, $this->randomName(), $this->randomName(), FALSE, TRUE); - $this->drupalGet('node/' . $node->nid, array('query' => 'page=0')); + $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0))); $this->assertFalse($this->commentExists($reply2, TRUE), t('In threaded mode where # replies > # comments per page, the newest reply does not appear on page 1.')); $this->drupalLogout(); Index: modules/contact/contact.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v retrieving revision 1.23 diff -u -p -r1.23 contact.pages.inc --- modules/contact/contact.pages.inc 20 Jul 2009 18:51:33 -0000 1.23 +++ modules/contact/contact.pages.inc 15 Sep 2009 23:29:44 -0000 @@ -155,7 +155,7 @@ function contact_personal_page($account) global $user; if (!valid_email_address($user->mail)) { - $output = t('You need to provide a valid e-mail address to contact other users. Please update your user information and try again.', array('@url' => url("user/$user->uid/edit", array('query' => 'destination=' . drupal_get_destination())))); + $output = t('You need to provide a valid e-mail address to contact other users. Please update your user information and try again.', array('@url' => url("user/$user->uid/edit", array('query' => drupal_get_destination())))); } elseif (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3)) && !user_access('administer site-wide contact form')) { $output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3))); Index: modules/openid/tests/openid_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/tests/openid_test.module,v retrieving revision 1.3 diff -u -p -r1.3 openid_test.module --- modules/openid/tests/openid_test.module 10 Jun 2009 20:13:20 -0000 1.3 +++ modules/openid/tests/openid_test.module 15 Sep 2009 23:35:35 -0000 @@ -229,5 +229,5 @@ function _openid_test_endpoint_authentic // Put the signed message into the query string of a URL supplied by the // Relying Party, and redirect the user. drupal_set_header('Content-Type', 'text/plain'); - header('Location: ' . url($_REQUEST['openid_return_to'], array('query' => http_build_query($response, '', '&'), 'external' => TRUE))); + header('Location: ' . url($_REQUEST['openid_return_to'], array('query' => $response, 'external' => TRUE))); } Index: modules/search/search.test =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.test,v retrieving revision 1.35 diff -u -p -r1.35 search.test --- modules/search/search.test 11 Sep 2009 15:39:48 -0000 1.35 +++ modules/search/search.test 15 Sep 2009 23:36:36 -0000 @@ -499,7 +499,7 @@ class SearchCommentTestCase extends Drup // Invoke search index update. $this->drupalLogout(); - $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))); + $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal')))); // Search for $title. $edit = array( @@ -521,7 +521,7 @@ class SearchCommentTestCase extends Drup // Invoke search index update. $this->drupalLogout(); - $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))); + $this->drupalGet($GLOBALS['base_url'] . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal')))); // Search for $title. $this->drupalPost('', $edit, t('Search')); Index: modules/simpletest/drupal_web_test_case.php =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v retrieving revision 1.148 diff -u -p -r1.148 drupal_web_test_case.php --- modules/simpletest/drupal_web_test_case.php 14 Sep 2009 19:05:06 -0000 1.148 +++ modules/simpletest/drupal_web_test_case.php 15 Sep 2009 23:39:27 -0000 @@ -1003,7 +1003,7 @@ class DrupalWebTestCase extends DrupalTe // Make a request to the logout page, and redirect to the user page, the // idea being if you were properly logged out you should be seeing a login // screen. - $this->drupalGet('user/logout', array('query' => 'destination=user')); + $this->drupalGet('user/logout', array('query' => array('destination' => 'user'))); $pass = $this->assertField('name', t('Username field found.'), t('Logout')); $pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout')); @@ -1804,7 +1804,7 @@ class DrupalWebTestCase extends DrupalTe $path = substr($path, $n); } if (isset($parts['query'])) { - $options['query'] = $parts['query']; + parse_str($parts['query'], $options['query']); } $path = url($path, $options); } Index: modules/simpletest/tests/browser_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/browser_test.module,v retrieving revision 1.1 diff -u -p -r1.1 browser_test.module --- modules/simpletest/tests/browser_test.module 17 Aug 2009 06:08:47 -0000 1.1 +++ modules/simpletest/tests/browser_test.module 15 Sep 2009 23:40:44 -0000 @@ -60,7 +60,7 @@ function browser_test_print_post_form_su function browser_test_refresh_meta() { if (!isset($_GET['refresh'])) { - $url = url('browser_test/refresh/meta', array('absolute' => TRUE, 'query' => 'refresh=true')); + $url = url('browser_test/refresh/meta', array('absolute' => TRUE, 'query' => array('refresh' => 'true'))); drupal_add_html_head(''); return ''; } @@ -70,7 +70,7 @@ function browser_test_refresh_meta() { function browser_test_refresh_header() { if (!isset($_GET['refresh'])) { - $url = url('browser_test/refresh/header', array('absolute' => TRUE, 'query' => 'refresh=true')); + $url = url('browser_test/refresh/header', array('absolute' => TRUE, 'query' => array('refresh' => 'true'))); drupal_set_header('Location', $url); return ''; } Index: modules/simpletest/tests/common.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v retrieving revision 1.71 diff -u -p -r1.71 common.test --- modules/simpletest/tests/common.test 5 Sep 2009 15:05:04 -0000 1.71 +++ modules/simpletest/tests/common.test 15 Sep 2009 23:42:25 -0000 @@ -261,12 +261,12 @@ class UrlTestCase extends DrupalWebtestC $test_url = 'http://www.drupal.org/?' . $query; // The external URL contains a query. - $result_url = url($test_url, array('query' => $query2)); + $result_url = url($test_url, array('query' => array($query2 => ''))); $this->assertEqual($test_url . '&' . $query2, $result_url, t("External URL with a query passed in the path paramater. url('http://drupal.org/?param1', array('query' => 'param2'));")); // The external URL does not contain a query. $test_url = 'http://www.drupal.org'; - $result_url = url($test_url, array('query' => $query2)); + $result_url = url($test_url, array('query' => array($query2 => ''))); $this->assertEqual($test_url . '?' . $query2, $result_url, t("External URL without a query passed in the path paramater. url('http://drupal.org', array('query' => 'param2'));")); } Index: modules/simpletest/tests/form.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v retrieving revision 1.14 diff -u -p -r1.14 form.test --- modules/simpletest/tests/form.test 13 Jul 2009 21:51:41 -0000 1.14 +++ modules/simpletest/tests/form.test 15 Sep 2009 23:43:55 -0000 @@ -430,10 +430,10 @@ class FormsFormStorageTestCase extends D $user = $this->drupalCreateUser(array('access content')); $this->drupalLogin($user); - $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', array('query' => 'cache=1')); + $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', array('query' => array('cache' => 1))); $this->assertText('Form constructions: 1', t('The form has been constructed one time till now.')); - $this->drupalPost(NULL, array(), 'Save', array('query' => 'cache=1')); + $this->drupalPost(NULL, array(), 'Save', array('query' => array('cache' => 1))); $this->assertText('Form constructions: 2', t('The form has been constructed two times till now.')); $this->assertText('Title: new', t('The form storage has stored the values.')); } Index: modules/statistics/statistics.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.admin.inc,v retrieving revision 1.32 diff -u -p -r1.32 statistics.admin.inc --- modules/statistics/statistics.admin.inc 29 Aug 2009 03:32:46 -0000 1.32 +++ modules/statistics/statistics.admin.inc 15 Sep 2009 23:45:11 -0000 @@ -130,9 +130,9 @@ function statistics_top_visitors() { $result = $query->execute(); $rows = array(); + $destination = drupal_get_destination(); foreach ($result as $account) { - $qs = drupal_get_destination(); - $ban_link = $account->iid ? l(t('unblock IP address'), "admin/config/people/ip-blocking/delete/$account->iid", array('query' => $qs)) : l(t('block IP address'), "admin/config/people/ip-blocking/$account->hostname", array('query' => $qs)); + $ban_link = $account->iid ? l(t('unblock IP address'), "admin/config/people/ip-blocking/delete/$account->iid", array('query' => $destination)) : l(t('block IP address'), "admin/config/people/ip-blocking/$account->hostname", array('query' => $destination)); $rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : ''); } Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.385 diff -u -p -r1.385 system.install --- modules/system/system.install 10 Sep 2009 06:38:20 -0000 1.385 +++ modules/system/system.install 15 Sep 2009 23:45:53 -0000 @@ -183,7 +183,7 @@ function system_requirements($phase) { } $description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))))); + $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal')))))); $requirements['cron'] = array( 'title' => $t('Cron maintenance tasks'), Index: modules/system/system.test =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.test,v retrieving revision 1.75 diff -u -p -r1.75 system.test --- modules/system/system.test 1 Sep 2009 16:50:12 -0000 1.75 +++ modules/system/system.test 15 Sep 2009 23:47:11 -0000 @@ -379,12 +379,12 @@ class CronRunTestCase extends DrupalWebT // Run cron anonymously with a random cron key. $key = $this->randomName(16); - $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key)); + $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => $key))); $this->assertResponse(403); // Run cron anonymously with the valid cron key. $key = variable_get('cron_key', 'drupal'); - $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key)); + $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => $key))); $this->assertResponse(200); // Execute cron directly. Index: modules/translation/translation.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.pages.inc,v retrieving revision 1.8 diff -u -p -r1.8 translation.pages.inc --- modules/translation/translation.pages.inc 29 Jul 2009 06:39:35 -0000 1.8 +++ modules/translation/translation.pages.inc 15 Sep 2009 23:47:48 -0000 @@ -47,7 +47,7 @@ function translation_node_overview($node // No such translation in the set yet: help user to create it. $title = t('n/a'); if (node_access('create', $node)) { - $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => "translation=$node->nid&language=$language->language")); + $options[] = l(t('add translation'), 'node/add/' . str_replace('_', '-', $node->type), array('query' => array('translation' => $node->nid, 'language' => $language->language))); } $status = t('Not translated'); }