From ddc781d7c95dde06f0168a608d0b3ce24796d8e0 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 21 Feb 2012 23:12:18 +0100 Subject: [PATCH] That regular expression can match a newline with [^#], which can spill commented out sauces. --- 4chan_x.user.js | 3 ++- script.coffee | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index ff5b068cc..7642c2b67 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2717,9 +2717,10 @@ var link, _i, _len, _ref; if (g.BOARD === 'f') return; this.links = []; - _ref = conf['sauces'].match(/^[^#].+$/gm); + _ref = conf['sauces'].split('\n'); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; + if (link[0] === '#') continue; this.links.push(this.funk(link)); } if (!this.links.length) return; diff --git a/script.coffee b/script.coffee index 598e7bcc2..e4f284fab 100644 --- a/script.coffee +++ b/script.coffee @@ -2231,7 +2231,8 @@ sauce = init: -> return if g.BOARD is 'f' @links = [] - for link in conf['sauces'].match /^[^#].+$/gm + for link in conf['sauces'].split '\n' + continue if link[0] is '#' @links.push @funk link return unless @links.length g.callbacks.push @node