mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Updated encoding logic in tracker and send.
This commit is contained in:
parent
4ee7deafdd
commit
91f49ba506
2 changed files with 30 additions and 8 deletions
|
|
@ -32,6 +32,20 @@
|
|||
|
||||
/* Helper functions */
|
||||
|
||||
const encode = str => {
|
||||
try {
|
||||
const result = decodeURI(str);
|
||||
|
||||
if (result !== str) {
|
||||
return result;
|
||||
}
|
||||
} catch {
|
||||
return str;
|
||||
}
|
||||
|
||||
return encodeURI(str);
|
||||
};
|
||||
|
||||
const parseURL = url => {
|
||||
return excludeSearch ? url.split('?')[0] : url;
|
||||
};
|
||||
|
|
@ -41,9 +55,9 @@
|
|||
hostname,
|
||||
screen,
|
||||
language,
|
||||
title: encodeURIComponent(title),
|
||||
url: encodeURI(currentUrl),
|
||||
referrer: encodeURI(currentRef),
|
||||
title: encode(title),
|
||||
url: encode(currentUrl),
|
||||
referrer: encode(currentRef),
|
||||
});
|
||||
|
||||
/* Event handlers */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue