From a6b8e3b76cdd98fc406cb2ac25f5512b6880a127 Mon Sep 17 00:00:00 2001 From: Aleksander Sklorz Date: Mon, 26 Jun 2023 10:35:50 +0200 Subject: [PATCH] ACS-5397 Corrected checking whitespace characters in regexp --- 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 b93253267a8..3dfeb2e7e43 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]; }