File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 102
102
result = { } ;
103
103
}
104
104
105
+ var decode = function ( s ) {
106
+ return s . replace ( / ( % [ 0 - 9 A - Z ] { 2 } ) + / g, decodeURIComponent ) ;
107
+ } ;
105
108
// To prevent the for loop in the first place assign an empty array
106
- // in case there are no cookies at all. Also prevents odd result when
107
- // calling "get()"
109
+ // in case there are no cookies at all.
108
110
var cookies = document . cookie ? document . cookie . split ( '; ' ) : [ ] ;
109
- var rdecode = / ( % [ 0 - 9 A - Z ] { 2 } ) + / g;
110
111
var i = 0 ;
111
112
112
113
for ( ; i < cookies . length ; i ++ ) {
118
119
}
119
120
120
121
try {
121
- var name = parts [ 0 ] . replace ( rdecode , decodeURIComponent ) ;
122
- cookie = converter . read ?
123
- converter . read ( cookie , name ) : converter ( cookie , name ) ||
124
- cookie . replace ( rdecode , decodeURIComponent ) ;
122
+ var name = decode ( parts [ 0 ] ) ;
123
+ cookie = ( converter . read || converter ) ( cookie , name ) ||
124
+ decode ( cookie ) ;
125
125
126
126
if ( this . json ) {
127
127
try {
You can’t perform that action at this time.
0 commit comments