diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-01-29 22:40:41 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-01-29 22:40:41 +0000 |
commit | 1df3cfffefefc93ed2d29041d148938d08bb9d4e (patch) | |
tree | 3f2488086535e8ce70f656f32113dd6eef4fd545 /misc | |
parent | 139f4375615216dfd077caba957508ff60778f45 (diff) | |
download | brdo-1df3cfffefefc93ed2d29041d148938d08bb9d4e.tar.gz brdo-1df3cfffefefc93ed2d29041d148938d08bb9d4e.tar.bz2 |
- Patch #284899 by c960657, voxpelli, mattconnolly: fixed Drupal url problem with clean urls.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/autocomplete.js | 2 | ||||
-rw-r--r-- | misc/drupal.js | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/misc/autocomplete.js b/misc/autocomplete.js index 8c839c7c3..73aafbf68 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.encodePath(searchString), + url: db.uri + '/' + encodeURIComponent(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 17997f400..c9d219898 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -282,14 +282,13 @@ Drupal.unfreezeHeight = function () { }; /** - * 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. + * Encodes a Drupal path for use in a URL. + * + * For aesthetic reasons slashes are not escaped. */ 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'); + return encodeURIComponent(item).replace(/%2F/g, '/'); }; /** |