trivantis-cookie.js fix

approg
approg Community Member Posts: 258 ♪ Opening Act ♪
I'm not sure if I've already posted this and it got lost or if I thought about it but never posted it.

Anyhow there a bug in trivantis-cookie.js that affects SCORM titles that store suspend_data and the names of pages in the titles include characters that are not web safe. You get this error displayed "Some of the persistent data was not able to be stored".

The bug has been around at least since version 11 and it occurs because there's a comparison made between encoded and decoded text (instead of both being decoded).

In version 17, at line 878 change

if( chkdata.length < newData.length ) {
bErr = true;
}

to

if( chkdata.length < newData.length ) {
if (chkdata != Decode(newData)) {
bErr = true;
}
}

As far as my testing goes, it doesn't break anything.

Comments

  • jvalley4735
    jvalley4735 Community Member Posts: 1,357
    I've brought the issue with development and they'll look at implementing a fix.  Thanks!