From: Mischa POSLAWSKY Date: Tue, 7 Dec 2010 20:35:06 +0000 (+0100) Subject: browser: prevent invalid test of column class X-Git-Tag: v1.4~45 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/f544f1d7860235fa4d86348e66deb3e1d5f0634a browser: prevent invalid test of column class Script failed for non-css queries, making complex regexes and comparisons like "<50" impossible. --- diff --git a/searchlocal.js b/searchlocal.js index eb284b7..99bffb2 100644 --- a/searchlocal.js +++ b/searchlocal.js @@ -67,7 +67,7 @@ function filtertable(query, action) { query = match[2]; } - if (document.querySelector('.b-a-'+query)) { + if (/^[a-z_]+$/.test(query) && document.querySelector('.b-a-'+query)) { // column if class b-a-* exists var match = function(th) { return new RegExp('-'+query+'\\b').test(th.className);