Unnecessary escape characters in cookie.js
Removed unnecessary escape characters from regex in "getCookie function in cookie.js" - . ( ) [ / + The above characters don't need escaping.
This commit is contained in:
parent
9680c673a3
commit
cd466c514a
1 changed files with 1 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
function getCookie(name) {
|
function getCookie(name) {
|
||||||
let matches = document.cookie.match(new RegExp(
|
let matches = document.cookie.match(new RegExp(
|
||||||
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
"(?:^|; )" + name.replace(/([.$?*|{}()[\]\\/+^])/g, '\\$1') + "=([^;]*)"
|
||||||
));
|
));
|
||||||
return matches ? decodeURIComponent(matches[1]) : undefined;
|
return matches ? decodeURIComponent(matches[1]) : undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue