Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix parsing = in jsonurl (#4185)

Karl-Aksel Puulmann272fdb81d00b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d55b88656f..a913e6e992 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Fix CSV import by adding a newline to the INSERT statement plausible/analytics#4172
+- Fix url parameters escaping of = sign plausible/analytics#4185
## v2.1.0 - 2024-05-23
diff --git a/assets/js/dashboard/query.js b/assets/js/dashboard/query.js
index 75000cc6a8..20d0535e13 100644
--- a/assets/js/dashboard/query.js
+++ b/assets/js/dashboard/query.js
@@ -43,8 +43,8 @@ export function parseQuery(querystring, site) {
match_day_of_week: matchDayOfWeek == 'true',
with_imported: q.get('with_imported') ? q.get('with_imported') === 'true' : true,
experimental_session_count: q.get('experimental_session_count'),
- filters: JsonURL.parse(q.get('filters')) || [],
- labels: JsonURL.parse(q.get('labels')) || {}
+ filters: parseJsonUrl(q.get('filters'), []),
+ labels: parseJsonUrl(q.get('labels'), {})
}
}
@@ -59,6 +59,13 @@ export function navigateToQuery(history, queryFrom, newData) {
history.push({ search: updatedQuery(newData) })
}
+function parseJsonUrl(value, defaultValue) {
+ if (!value) {
+ return defaultValue
+ }
+ return JsonURL.parse(value.replaceAll("=", "%3D"))
+}
+
const LEGACY_URL_PARAMETERS = {
'goal': null,
'source': null,