summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-11-15 10:50:30 +0000
committeralecpl <alec@alec.pl>2011-11-15 10:50:30 +0000
commit3fec6952ddbff1b5b487ea2927928338f39e4fef (patch)
treec684fe925e092fd78e1a2048eab4357bce7aacee /program/js
parentecfaed571b2c38f4bcc2b6a0fa39fba15a5126ce (diff)
- Applied fixes from trunk up to r5425
Diffstat (limited to 'program/js')
-rw-r--r--program/js/common.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/program/js/common.js b/program/js/common.js
index 831e44a21..c13d95e3d 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -542,10 +542,17 @@ function rcube_clone_object(obj)
return out;
};
-// make a string URL safe
+// make a string URL safe (and compatible with PHP's rawurlencode())
function urlencode(str)
{
- return window.encodeURIComponent ? encodeURIComponent(str) : escape(str);
+ if (window.encodeURIComponent)
+ return encodeURIComponent(str).replace('*', '%2A');
+
+ return escape(str)
+ .replace('+', '%2B')
+ .replace('*', '%2A')
+ .replace('/', '%2F')
+ .replace('@', '%40');
};