watched words regular expressions 설정을 활성화하면, 잘못된 정규식 때문에 해당 감시 단어 카테고리가 완전히 깨집니다.
재현 방법
- 'watched words regular expressions’를 활성화합니다.
- 'Require Approval’에 감시 단어 패턴을 추가합니다. 예:
same issue. - 잘못된 감시 단어 패턴을 추가합니다. 예:
*ban*(정규식을 활성화하기 전에 감시 단어에 와일드카드가 있었던 경우와 같습니다). - 'same issue’를 포함하는 게시물이 승인 대기열을 건너뛰고, ‘Test’ 양식에서도 무시되는 것을 확인합니다.
- 잘못된 감시 단어를 제거합니다.
- 이제 'same issue’가 올바르게 일치하는 것을 확인합니다.
재현 방법 (더 나쁜 경우):
- 'watched words regular expressions’와 태그를 활성화합니다.
- 'Tag’에 잘못된 감시 단어 패턴을 추가합니다. 예:
*tebex.io*→paid. - 새 주제를 게시해 봅니다. 이는
/logs에 다음 결과가 기록된 'Error 500’을 반환합니다:
RegexpError (target of repeat operator is not specified: /*tebex.io*/)
app/services/word_watcher.rb:116:in `initialize'
app/services/word_watcher.rb:116:in `new'
app/services/word_watcher.rb:116:in `matches?'
lib/topic_creator.rb:184:in `block in setup_tags'
lib/topic_creator.rb:183:in `each'
lib/topic_creator.rb:183:in `setup_tags'
lib/topic_creator.rb:46:in `create'
lib/post_creator.rb:501:in `create_topic'
참고
정규식이 비활성화되어 있더라도, 예를 들어 / 블록으로 감싸는 경우와 같이 와일드카드와 유사하게 유효한 정규식을 입력할 수 있다면 좋겠습니다. 특히 기존 감시 단어에 와일드카드가 이미 있는 경우 토글이 나쁜 방식으로 깨지기 때문입니다.