Bug 10956 - Series of OPAC searches can cause a browser crash
authorMarc Véron <veron@veron.ch>
Wed, 19 Nov 2014 10:40:39 +0000 (11:40 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 25 Nov 2014 19:12:34 +0000 (16:12 -0300)
commitc087027487ad84946b4e0861d6903f3f1cea7118
treeff052e4dd7df33128d82b76221fff87983ab29bd
parentb4c0eb4a518b20ad8115ebfad6e28303c91203e5
Bug 10956 - Series of OPAC searches can cause a browser crash

This patch fixes the issue for bootstrap. It was earlier fixed for the prog theme.

Solution: Prevent  jQuery.fn.highlight = function(pat) to be called with empty pat
by skipping empty values in highlight loop.

To test:
Without patch, do a search as in comment #1 odr #3
Result: Endless loop (Script not responding)

Appply patch:
No endless loop, page displays OK

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
To reproduce you need to search a string with 2 spaces.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I didn't manage to reproduce the problem, but I couldn't find
any regression either trying multiple searches.
Trusting Marc's and Jonathan's testing.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt