function drupal_http_build_query

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 common.inc drupal_http_build_query(array $query, $parent = '')
cle7 common.inc drupal_http_build_query(array $query, $parent = '')
elmsmedia7 common.inc drupal_http_build_query(array $query, $parent = '')
icor7 common.inc drupal_http_build_query(array $query, $parent = '')
meedjum_blog7 common.inc drupal_http_build_query(array $query, $parent = '')
mooc7 common.inc drupal_http_build_query(array $query, $parent = '')

Parses an array into a valid, rawurlencoded query string.

This differs from http_build_query() as we need to rawurlencode() (instead of urlencode()) all query parameters.

Parameters

$query: The query parameter array to be processed, e.g. $_GET.

$parent: Internal use only. Used to build the $query array key for nested items.

Return value

A rawurlencoded string which can be used as or appended to the URL query string.

See also

drupal_get_query_parameters()

Related topics

13 calls to drupal_http_build_query()
admin_menu_page_build in sites/all/modules/ulmus/admin_menu/admin_menu.module
Implements hook_page_build().
bakery_request_account in sites/all/modules/ulmus/bakery/bakery.module
Request account information from master to create account locally.
bakery_user_update in sites/all/modules/ulmus/bakery/bakery.module
Implements hook_user_update().
drupal_current_script_url in includes/install.inc
Returns the URL of the current script, with modified query parameters.
drupal_get_destination in includes/common.inc
Prepares a 'destination' URL query parameter for use with drupal_goto().

... See full list

File

includes/common.inc, line 486
Common functions that many Drupal modules will need to reference.

Code

function drupal_http_build_query(array $query, $parent = '') {
  $params = array();

  foreach ($query as $key => $value) {
    $key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key));

    // Recurse into children.
    if (is_array($value)) {
      $params[] = drupal_http_build_query($value, $key);
    }
    // If a query parameter value is NULL, only append its key.
    elseif (!isset($value)) {
      $params[] = $key;
    }
    else {
      // For better readability of paths in query strings, we decode slashes.
      $params[] = $key . '=' . str_replace('%2F', '/', rawurlencode($value));
    }
  }

  return implode('&', $params);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.