diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-07-03 19:21:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-07-03 19:21:55 +0000 |
commit | e49ac650a665ed864a9343dc5a97b5ae465cc744 (patch) | |
tree | 9cbe07fafd4d9250808509c8ba099f4b566000bc /misc | |
parent | c90e16721a0660dc2dedbd31a9df428e03b7ff13 (diff) | |
download | brdo-e49ac650a665ed864a9343dc5a97b5ae465cc744.tar.gz brdo-e49ac650a665ed864a9343dc5a97b5ae465cc744.tar.bz2 |
- Patch #310139 by pwolanin, c960657: drupal_query_string_encode() should not call drupal_urlencode().
Diffstat (limited to 'misc')
-rw-r--r-- | misc/autocomplete.js | 2 | ||||
-rw-r--r-- | misc/drupal.js | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/misc/autocomplete.js b/misc/autocomplete.js index 706a0cf2f..bed9b65ae 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -276,7 +276,7 @@ Drupal.ACDB.prototype.search = function (searchString) { // Ajax GET request for autocompletion. $.ajax({ type: 'GET', - url: db.uri + '/' + Drupal.encodeURIComponent(searchString), + url: db.uri + '/' + Drupal.encodePath(searchString), dataType: 'json', success: function (matches) { if (typeof matches.status == 'undefined' || matches.status != 0) { diff --git a/misc/drupal.js b/misc/drupal.js index e71adda75..40a21b0f1 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -263,10 +263,11 @@ Drupal.unfreezeHeight = function () { }; /** - * Wrapper to address the mod_rewrite url encoding bug - * (equivalent of drupal_urlencode() in PHP). + * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of + * drupal_encode_path() in PHP). This function should only be used on paths, not + * on query string arguments. */ -Drupal.encodeURIComponent = function (item, uri) { +Drupal.encodePath = function (item, uri) { uri = uri || location.href; item = encodeURIComponent(item).replace(/%2F/g, '/'); return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F'); |