summaryrefslogtreecommitdiff
path: root/misc/drupal.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-01-29 22:40:41 +0000
committerDries Buytaert <dries@buytaert.net>2010-01-29 22:40:41 +0000
commit1df3cfffefefc93ed2d29041d148938d08bb9d4e (patch)
tree3f2488086535e8ce70f656f32113dd6eef4fd545 /misc/drupal.js
parent139f4375615216dfd077caba957508ff60778f45 (diff)
downloadbrdo-1df3cfffefefc93ed2d29041d148938d08bb9d4e.tar.gz
brdo-1df3cfffefefc93ed2d29041d148938d08bb9d4e.tar.bz2
- Patch #284899 by c960657, voxpelli, mattconnolly: fixed Drupal url problem with clean urls.
Diffstat (limited to 'misc/drupal.js')
-rw-r--r--misc/drupal.js9
1 files changed, 4 insertions, 5 deletions
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, '/');
};
/**