Why does watched words have a 1000 word limit?

Hello,
i wish that the bad word list have no limit anymore.

It’s not clear what you’re asking for.

Can you be more specific? Do you have an example?

3 Likes

There is currently a limit of maximum 1000 Words

Looks like it’s a hard limit. Could be overriden with a plugin, from watched_words.rb:

  MAX_WORDS_PER_ACTION = 1000

  before_validation do
    self.word = self.class.normalize_word(self.word)
  end

  validates :word,   presence: true, uniqueness: true, length: { maximum: 50 }
  validates :action, presence: true
  validates_each :word do |record, attr, val|
    if WatchedWord.where(action: record.action).count >= MAX_WORDS_PER_ACTION
      record.errors.add(:word, :too_many)
    end
  end

@preterive I’m curious… why do you have so many banned words? How many do you need?

Are they all offensive words, or are you using this functionality for something else?

4 Likes

I Want to Block all links to illegal websites.

Maybe you should use a whitelist approach if your blacklist is so big…

1 Like

You’re never going to block them all, mirrors spring up faster than you can block them. Whitelisting would be the only solution, either that or filter and ban links all together.

2 Likes