Skip to content

Commit

Permalink
Use ':' as separator in collapse_settings cookie
Browse files Browse the repository at this point in the history
Previously we were using a comma, which is not a valid character in a
cookie (per RFC6265 section 4.1.1 [1]).

Fixes #20822

[1] http://tools.ietf.org/html/rfc6265#section-4.2.1 [^]
  • Loading branch information
dregad committed Apr 18, 2016
1 parent d4d4257 commit e3956c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/collapse_api.php
Expand Up @@ -209,7 +209,7 @@ function collapse_cache_token() {
$t_data = explode( '|', $t_cookie );

foreach( $t_data as $t_pair ) {
$t_pair = explode( ',', $t_pair );
$t_pair = explode( ':', $t_pair );

if( false !== $t_pair && count( $t_pair ) == 2 ) {
$g_collapse_cache_token[$t_pair[0]] = ( true == $t_pair[1] );
Expand Down
4 changes: 2 additions & 2 deletions js/common.js
Expand Up @@ -389,9 +389,9 @@ function ToggleDiv( p_div ) {
}

if ( t_open_display == "none" ) {
t_cookie = t_cookie + "|" + p_div + ",1";
t_cookie = t_cookie + "|" + p_div + ":1";
} else {
t_cookie = t_cookie + "|" + p_div + ",0";
t_cookie = t_cookie + "|" + p_div + ":0";
}

SetCookie( "collapse_settings", t_cookie );
Expand Down

0 comments on commit e3956c2

Please sign in to comment.