From 9dd9347d17b2b3d3f580f5a6664630ff6cd05ef1 Mon Sep 17 00:00:00 2001 From: AleksanderSklorz <115619721+AleksanderSklorz@users.noreply.github.com> Date: Tue, 27 Jun 2023 08:33:26 +0200 Subject: [PATCH] [ACS-5397] Corrected checking whitespace characters in regexp (#8704) --- lib/core/src/lib/common/services/cookie.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/lib/common/services/cookie.service.ts b/lib/core/src/lib/common/services/cookie.service.ts index b93253267a..3dfeb2e7e4 100644 --- a/lib/core/src/lib/common/services/cookie.service.ts +++ b/lib/core/src/lib/common/services/cookie.service.ts @@ -51,7 +51,7 @@ export class CookieService { * @returns The cookie data or null if it is not found */ getItem(key: string): string | null { - const regexp = new RegExp('(?:' + key + '|;\s*' + key + ')=(.*?)(?:;|$)', 'g'); + const regexp = new RegExp('(?:' + key + '|;\\s*' + key + ')=(.*?)(?:;|$)', 'g'); const result = regexp.exec(document.cookie); return (result === null) ? null : result[1]; }