mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Replace watched words with wildcards (#24279)
These have been broken since fd07c943ad
because watched words were not correctly transformed to regexps.
This partially reverts the changes.
This commit is contained in:
@@ -191,8 +191,8 @@ class TopicCreator
|
||||
if watched_words.present?
|
||||
word_watcher = WordWatcher.new("#{@opts[:title]} #{@opts[:raw]}")
|
||||
word_watcher_tags = topic.tags.map(&:name)
|
||||
watched_words.each do |word, opts|
|
||||
if word_watcher.word_matches?(word, case_sensitive: opts[:case_sensitive])
|
||||
watched_words.each do |_, opts|
|
||||
if word_watcher.word_matches?(opts[:word], case_sensitive: opts[:case_sensitive])
|
||||
word_watcher_tags += opts[:replacement].split(",")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user