[marginalia] r556 committed - CookieBus was failing if the cookie text included a colon

1 view
Skip to first unread message

margi...@googlecode.com

unread,
Jun 26, 2012, 2:01:34 AM6/26/12
to marginali...@googlegroups.com
Revision: 556
Author: geof.glass
Date: Mon Jun 25 23:01:22 2012
Log: CookieBus was failing if the cookie text included a colon

http://code.google.com/p/marginalia/source/detail?r=556

Modified:
/marginalia-lib/trunk/marginalia/domutil.js

=======================================
--- /marginalia-lib/trunk/marginalia/domutil.js Wed May 30 14:51:38 2012
+++ /marginalia-lib/trunk/marginalia/domutil.js Mon Jun 25 23:01:22 2012
@@ -1766,11 +1766,11 @@

CookieBus.parseCookieValue = function( raw )
{
- raw = raw.split( ':' );
- var control = raw[ 0 ];
- var text = raw[ 1 ];
+ var x = raw.indexOf( ':' );
+ var control = raw.substr(0, x );
+ var text = raw.substr( x + 1 );
var paramstrs = control.split( '&' );
- var params = { value: raw[ 1 ] };
+ var params = { value: text };
for ( var i = 0; i < paramstrs.length; ++i )
{
var p = paramstrs[ i ].split( '=' );
Reply all
Reply to author
Forward
0 new messages