Some filters break bSaveState functionality

Some filters break bSaveState functionality

pidgepidge Posts: 1Questions: 0Answers: 0
edited August 2010 in Bug reports
Filters applied via fnFilter aren't escaped fully when the JSON for the cookie is created in _fnSaveState.

Some filters, particularly regex filters containing backslashes (ex: "^\s*CVM\s*$"), will result in the JSON being invalid. The backslashes in the example are not escaped, which is not allowed.

When _fnLoadState tries to load the resulting cookie, it fails, and the table state is not restored.

I fixed this locally by relying on the JSON library to do the escaping.

REPLACED:
[code]
for ( i=0 ; i

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi pidge,

    Thanks very much for catching this! I'm make sure it is fixed in the next release of DataTables. It won't use JSON.stringify unfortunately (since that would add another library dependency - I really with jQuery would include this ability...), but I'll try to make sure that this is properly escaped - good to see you've got a patch already!

    Regards,
    Allan
This discussion has been closed.