[Rt-devel] Rollups and cookie issue with $title_b64

Peterson, Erik epeterson at edc.org
Fri Aug 1 11:50:17 EDT 2008

I am looking at 3.8.0 and one problem I noticed is that (seemingly) randomly
various boxes wouldn¹t maintain their rollup state.

I traced the issue to the change in share/html/Widgets/TitleBoxStart

> my $tid  = "TitleBox--$page--" .
>             join '--', ($class, $bodyclass, $title, $id);

And in 3.8:

> my $title_b64 = MIME::Base64::encode_base64(Encode::encode_utf8($title), '');
> my $tid  = "TitleBox--$page--" .
>             join '--', ($class, $bodyclass, $title_b64, $id);

What this caused was that when the $title was encoded, it sometimes ended up
with one or more equal signs, ³=² in the new variable $title_b64.

From: http://perldoc.perl.org/MIME/Base64.html
> A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used

However, in NoAuth/js/titlebox-state.js, the cookies are split on ³=²

> var c = cookies[i].split('=');

Which means that the script never recognizes this title as being rolled

I assume this is due to the need for multi-byte character sets for the
titles but I¹m not quite sure the best way to get around this.  Actually,
it¹ll be easy for me since we won¹t have multi-byte titles, I could go back
to the unencoded version, but that¹s only a fix for me...


More information about the Rt-devel mailing list