From 995d7d01ab2f1a0a378fcf180f069845a454689a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 13 Dec 2013 11:22:14 +0100 Subject: [PATCH] Fix: replace-all now handles the case where new string contains the old one as a substring This led to infinite loop. --- redakcja/static/js/wiki/view_search.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/redakcja/static/js/wiki/view_search.js b/redakcja/static/js/wiki/view_search.js index ae0fd2db..21127dc3 100644 --- a/redakcja/static/js/wiki/view_search.js +++ b/redakcja/static/js/wiki/view_search.js @@ -90,12 +90,8 @@ else {} self.searchCursor.select(); self.searchCursor.replace(query); - var found = self.search(); - if(self.options['replace-all']) { - while(found) { - self.replace(); - found = self.search(); - } + if(self.options['replace-all'] && self.search()) { + self.replace(); } }; -- 2.20.1