mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FIX: Make serialized watched word regex Javascript compatible (#22010)
This change ensures Javascript compatible regex is serialized instead of the default ruby based one.
This commit is contained in:
@ -18,7 +18,7 @@ class WatchedWordListSerializer < ApplicationSerializer
|
||||
def compiled_regular_expressions
|
||||
expressions = {}
|
||||
actions.each do |action|
|
||||
expressions[action] = WordWatcher.serializable_word_matcher_regexp(action)
|
||||
expressions[action] = WordWatcher.serializable_word_matcher_regexp(action, engine: :js)
|
||||
end
|
||||
expressions
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ class WatchedWordSerializer < ApplicationSerializer
|
||||
attributes :id, :word, :regexp, :replacement, :action, :case_sensitive
|
||||
|
||||
def regexp
|
||||
WordWatcher.word_to_regexp(word)
|
||||
WordWatcher.word_to_regexp(word, engine: :js)
|
||||
end
|
||||
|
||||
def action
|
||||
|
Reference in New Issue
Block a user