diff --git a/4chan_x.user.js b/4chan_x.user.js index 036f4f56e..5fc160ad6 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -564,15 +564,15 @@ if (boards !== 'global' && boards.split(',').indexOf(g.BOARD) === -1) { continue; } - try { - if (key === 'md5') { - regexp = regexp[1]; - } else { + if (key === 'md5') { + regexp = regexp[1]; + } else { + try { regexp = RegExp(regexp[1], regexp[2]); + } catch (err) { + alert(err.message); + continue; } - } catch (e) { - alert(e.message); - continue; } op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'no'; stub = (function() { diff --git a/script.coffee b/script.coffee index 9172135df..220ca5a75 100644 --- a/script.coffee +++ b/script.coffee @@ -437,17 +437,17 @@ Filter = if boards isnt 'global' and boards.split(',').indexOf(g.BOARD) is -1 continue - try - if key is 'md5' - # MD5 filter will use strings instead of regular expressions. - regexp = regexp[1] - else + if key is 'md5' + # MD5 filter will use strings instead of regular expressions. + regexp = regexp[1] + else + try # Please, don't write silly regular expressions. regexp = RegExp regexp[1], regexp[2] - catch e - # I warned you, bro. - alert e.message - continue + catch err + # I warned you, bro. + alert err.message + continue # Filter OPs along with their threads, replies only, or both. # Defaults to replies only.