Permalink
Browse files

detect & report invalid regexp in search query

  • Loading branch information...
sunaku committed Nov 6, 2009
1 parent 7407c20 commit 3502dfe562c23e46326baf05d8b5693572e6f852
Showing with 9 additions and 0 deletions.
  1. +9 −0 fmt/xhtml.yaml
View
@@ -1207,6 +1207,15 @@ javascript: |
return;
}
+ // detect invalid regexps
+ try {
+ new RegExp(query);
+ }
+ catch(e) {
+ alert(e);
+ return;
+ }
+
// one search at a time
if (search_box.attr('disabled')) {
return;

0 comments on commit 3502dfe

Please sign in to comment.