From 5f628d6ce48bd2214a2d349fca5e09a8e83e1854 Mon Sep 17 00:00:00 2001 From: MoritzRS Date: Fri, 24 Sep 2021 14:52:19 +0200 Subject: [PATCH] fix: no search results displayed when filter name contains special characters (#885) --- src/app/core/utils/url-form-params.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/utils/url-form-params.ts b/src/app/core/utils/url-form-params.ts index f66c2a309e..72b295ca40 100644 --- a/src/app/core/utils/url-form-params.ts +++ b/src/app/core/utils/url-form-params.ts @@ -21,7 +21,7 @@ export function appendFormParamsToHttpParams( return object ? Object.entries(object) .filter(([, value]) => Array.isArray(value) && value.length) - .reduce((p, [key, val]) => p.set(decodeURI(key), val.map(decodeURI).join(separator)), params) + .reduce((p, [key, val]) => p.set(key, val.join(separator)), params) : params; } @@ -32,7 +32,7 @@ export function stringToFormParams(object: string, separator = ','): URLFormPara .filter(val => val && val.includes('=')) .map(val => { const [key, values] = val.split('='); - return { key, value: values.split(separator) }; + return { key: decodeURIComponent(key), value: values.split(separator).map(decodeURIComponent) }; }) .reduce((acc, val) => ({ ...acc, [val.key]: val.value }), {}) : {};