File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 102102 result = { } ;
103103 }
104104
105+ var decode = function ( s ) {
106+ return s . replace ( / ( % [ 0 - 9 A - Z ] { 2 } ) + / g, decodeURIComponent ) ;
107+ } ;
105108 // 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.
108110 var cookies = document . cookie ? document . cookie . split ( '; ' ) : [ ] ;
109- var rdecode = / ( % [ 0 - 9 A - Z ] { 2 } ) + / g;
110111 var i = 0 ;
111112
112113 for ( ; i < cookies . length ; i ++ ) {
118119 }
119120
120121 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 ) ;
125125
126126 if ( this . json ) {
127127 try {
You can’t perform that action at this time.
0 commit comments