summaryrefslogtreecommitdiff
path: root/misc/drupal.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-03 19:21:55 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-03 19:21:55 +0000
commite49ac650a665ed864a9343dc5a97b5ae465cc744 (patch)
tree9cbe07fafd4d9250808509c8ba099f4b566000bc /misc/drupal.js
parentc90e16721a0660dc2dedbd31a9df428e03b7ff13 (diff)
downloadbrdo-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/drupal.js')
-rw-r--r--misc/drupal.js7
1 files changed, 4 insertions, 3 deletions
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');