From 47dcd35d234db791fc8a5c473004ce57dec77e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 18 Nov 2014 20:24:42 +0100 Subject: [PATCH] [HACK] Bug 10956 - Series of OPAC searches can cause a browser crash This is a hack to track down the issue with an endless loop while highlighting words. I changed function innerHighlight(node, pat) to break out of loop after a while. With this hack I can no longer reproduce the bug. It is not a solution, but it could help to track down the problem. --- .../opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js index 69bb52d..4538f62 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js +++ b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js @@ -33,6 +33,9 @@ jQuery.fn.highlight = function(pat) { else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) { for (var i = 0; i < node.childNodes.length; ++i) { i += innerHighlight(node.childNodes[i], pat); + // HACK FOR TESTING BUG 10956 + // Break out of loop with huge i + if (i > 400) break; } } return skip; -- 1.7.10.4