diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-05-20 08:42:38 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-05-20 08:42:38 +0300 |
commit | 52767315938d5d717731fa2d7a07da59ba663b82 (patch) | |
tree | a21bb4905ca17d3e533faa78129a84774f163e5e /js | |
parent | bc703344b4f8b5ce24c2c561a3c4d62bdc57cf66 (diff) |
Fixes #5014 - Encode URLs using Javascript encodeURIComponent so it works with utf-8 characters
Previously was using unescape which did not work well with utf8 non ascii characters.
Diffstat (limited to 'js')
-rw-r--r-- | js/piwik.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/js/piwik.js b/js/piwik.js index 8d1a735e32..3dd95a7927 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -513,9 +513,6 @@ if (typeof Piwik !== 'object') { /* decode */ decodeWrapper = windowAlias.decodeURIComponent, - /* urldecode */ - urldecode = unescape, - /* asynchronous tracker */ asyncTracker, @@ -799,7 +796,7 @@ if (typeof Piwik !== 'object') { * UTF-8 encoding */ function utf8_encode(argString) { - return urldecode(encodeWrapper(argString)); + return decodeWrapper(encodeWrapper(argString)); } /************************************************************ @@ -3857,8 +3854,7 @@ if (typeof Piwik !== 'object') { var link = getLinkIfShouldBeProcessed(sourceElement); if (link && link.type) { - // urldecode %xx - link.href = urldecode(link.href); + link.href = decodeWrapper(link.href); logLink(link.href, link.type, undefined, null, sourceElement); } } |