Loading a filter that contains a quote (") from a saved session causes an invalid display

Loading a filter that contains a quote (") from a saved session causes an invalid display

lucasmopdxlucasmopdx Posts: 1Questions: 0Answers: 0
edited May 2014 in Bug reports

Around line 2662, there's the following line of code:
.val( previousSearch.sSearch.replace('"','"') )

This should simply be:
.val( previousSearch.sSearch )

Otherwise, the saved search is corrupted. For an example, go to the datatables example (https://datatables.net/examples/basic_init/state_save.html) and enter a quote in the box. Then, reload the page and watch it turn to " in the search box.

Replies

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    That's interesting - I'm not actually seeing that behaviour myself, however, I completely agree that it is wrong to do that escape. Took be a while to figure out what it was even doing there - it was added way back in the DataTables 1.3.x series and back then the filter input was constructed as a string rather than a DOM element, so the escape was required. No longer and I've now removed it.

    Thanks for flagging this up! It will be in 1.10.1 and in the nightly shortly.

    Regards,
    Allan

This discussion has been closed.