We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a73bd2 commit 214a23eCopy full SHA for 214a23e
SERVER_SIDE.md
@@ -36,10 +36,11 @@ var PHPCookies = Cookies.withConverter({
36
},
37
read: function (value) {
38
return value
39
- // Decode all characters according to the "encodeURIComponent" spec
40
- .replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
41
- // Decode the plus sign to spaces
+ // Decode the plus sign to spaces first, otherwise "legit" encoded pluses
+ // will be replaced incorrectly
42
.replace(/\+/g, ' ')
+ // Decode all characters according to the "encodeURIComponent" spec
43
+ .replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
44
}
45
});
46
```
0 commit comments