]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #278 - Use mb_chars.downcase on hashtags
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 26 Nov 2016 14:24:14 +0000 (15:24 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 26 Nov 2016 14:24:14 +0000 (15:24 +0100)
app/services/process_hashtags_service.rb

index 3bf3471ec4cf3bbb5add17e6553ce8f63ffa830e..fa14c44da59ab7b4efb593ef3d851cea83fe281f 100644 (file)
@@ -4,7 +4,7 @@ class ProcessHashtagsService < BaseService
   def call(status, tags = [])
     tags = status.text.scan(Tag::HASHTAG_RE).map(&:first) if status.local?
 
-    tags.map(&:downcase).uniq.each do |tag|
+    tags.map { |str| str.mb_chars.downcase }.uniq.each do |tag|
       status.tags << Tag.where(name: tag).first_or_initialize(name: tag)
     end
   end