diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-11-14 09:09:21 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-11-14 09:09:21 +0000 |
| commit | e5273f1164d8dc1eed373c5ecc5480fbbbf56808 (patch) | |
| tree | 55f5cb95e9a4d7f4154066f72b03d4363056d3d8 /roundcubemail | |
| parent | b7c0ca0f6893f15bb8ebc5c57c522805afe3eac8 (diff) | |
- Make urlencode() compatible with PHP's rawurlencode() - fixes collapsing/expanding of folders with some special characters in name
git-svn-id: https://svn.roundcube.net/trunk@5420 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
| -rw-r--r-- | roundcubemail/program/js/common.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/roundcubemail/program/js/common.js b/roundcubemail/program/js/common.js index 831e44a21..c13d95e3d 100644 --- a/roundcubemail/program/js/common.js +++ b/roundcubemail/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'); }; |
