[Bug 8646] New: Certain search terms cause browser "script taking too long" error
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Priority: P5 - low Change sponsored?: --- Bug ID: 8646 CC: gmcharlt@gmail.com Assignee: koha-bugs@lists.koha-community.org Summary: Certain search terms cause browser "script taking too long" error Severity: minor Classification: Unclassified OS: All Reporter: robin@catalyst.net.nz Hardware: All Status: NEW Version: master Component: Staff Client Product: Koha Some search terms, particularly those with space characters and similar non-alpha things at the end, can cause the javascript highlighter to go into an infinite loop which causes an error in the browser. Search queries such as: http://koha-intra/cgi-bin/koha/catalogue/search.pl?kw=idx&q=ti:book%20 reproduce this. Curiously, the OPAC is unaffected by this, however it has similar code processes that mean it may be possible for this to happen there too. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |robin@catalyst.net.nz |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 --- Comment #1 from Robin Sheat <robin@catalyst.net.nz> --- Created attachment 11641 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11641&action=edit Bug 8646 - prevent the highlighter from going infinite loop On certain search queries, for example http://koha-intra/cgi-bin/koha/catalogue/search.pl?kw=idx&q=ti:book%20 the highlighter starts going into an infinite loop until the browser decides to kill it. This patch prevents the bad input going to the highlighter. It also includes the fix on the OPAC, even though the issue doesn't come up there. Better to be safe... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 11658 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11658&action=edit Bug 8646 - prevent the highlighter from going infinite loop On certain search queries, for example http://koha-intra/cgi-bin/koha/catalogue/search.pl?kw=idx&q=ti:book%20 the highlighter starts going into an infinite loop until the browser decides to kill it. This patch prevents the bad input going to the highlighter. It also includes the fix on the OPAC, even though the issue doesn't come up there. Better to be safe... Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |jonathan.druart@biblibre.co | |m --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Works as expected. I fixed that (in BibLibre repo) with: function highlightOn() { var x; for (x in q_array) { - $("p").highlight(q_array[x]); + if ( q_array[x].length > 0 ) { + $("p").highlight(q_array[x]); + } } $(".highlight_toggle").toggle(); } But your patch looks good too. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |koha.sekjal@gmail.com --- Comment #4 from Ian Walls <koha.sekjal@gmail.com> --- Drops empty strings are the end of the array in order to prevent infinite loops. Template only change in JS. Marking Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #11641|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_8 --- Comment #5 from Paul Poulain <paul.poulain@biblibre.com> --- Patch pushed to master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x will be in 3.8.5 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ago@bywatersolutions.com --- Comment #7 from Robin Sheat <robin@catalyst.net.nz> --- *** Bug 8736 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8646 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10956 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org