2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

Fix for foreign language titles: Only enforce upper case rule on english alphabet.

This commit is contained in:
Robin Ward 2013-02-14 16:09:57 -05:00
parent b9457197c0
commit d740d7b25f
2 changed files with 11 additions and 4 deletions

View file

@ -54,8 +54,8 @@ class TextSentinel
return false if @opts[:max_word_length] and @text =~ /\w{#{@opts[:max_word_length]},}(\s|$)/
# We don't allow all upper case content
return false if @text == @text.upcase
# We don't allow all upper case content in english
return false if (@text =~ /[A-Z]+/) and (@text == @text.upcase)
true
end