browser: prevent invalid test of column class
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 7 Dec 2010 20:35:06 +0000 (21:35 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 15 Dec 2010 21:40:44 +0000 (22:40 +0100)
Script failed for non-css queries, making complex regexes and comparisons
like "<50" impossible.

searchlocal.js

index eb284b7a53d3ffe53736e5b84079672364d9f2d8..99bffb2d272372139e08561cb4c7822281aeae69 100644 (file)
@@ -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);