[ACS-5397] Corrected checking whitespace characters in regexp (#8704)

This commit is contained in:
AleksanderSklorz
2023-06-27 08:33:26 +02:00
committed by GitHub
parent be896b502f
commit 9dd9347d17

View File

@@ -51,7 +51,7 @@ export class CookieService {
* @returns The cookie data or null if it is not found * @returns The cookie data or null if it is not found
*/ */
getItem(key: string): string | null { 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); const result = regexp.exec(document.cookie);
return (result === null) ? null : result[1]; return (result === null) ? null : result[1];
} }