Commit 11fe390b534ec06667eb5a992663d8e569de0fc1
1 parent
d3068ea5
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Fixed UTF8 validation for tweets "Attention please, don't remove + ' ')[0..-2] i…
…t is used for UTF8 validation"
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb
... | ... | @@ -20,14 +20,16 @@ module Twurl |
20 | 20 | begin |
21 | 21 | parsed = JSON.parse(chunk) |
22 | 22 | ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') |
23 | - comment_text = ic.iconv(parsed["text"])[0..-2] | |
23 | + #Attention please, don't remove + ' ')[0..-2] it is used for UTF8 validation | |
24 | + comment_text = ic.iconv(parsed["text"] + ' ')[0..-2] | |
24 | 25 | print "#{comment_text}\n" |
25 | 26 | comment = Comment.new |
26 | 27 | comment.title = 'hub-message-twitter' |
27 | 28 | comment.source = options.page |
28 | 29 | comment.body = comment_text |
29 | 30 | comment.author_id = options.author_id |
30 | - comment.name = ic.iconv(parsed["user"]["name"])[0..-2] | |
31 | + #Attention please, don't remove + ' ')[0..-2] it is used for UTF8 validation | |
32 | + comment.name = ic.iconv(parsed["user"]["name"] + ' ')[0..-2] | |
31 | 33 | comment.email = 'admin@localhost.local' |
32 | 34 | comment.save! |
33 | 35 | rescue => e | ... | ... |