Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Fix Pantography spamify
Browse files Browse the repository at this point in the history
Test for A and H before converting to lowercase.
  • Loading branch information
joegatt committed Dec 20, 2013
1 parent 432d46c commit 295edee
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions app/models/pantograph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,14 @@ def self.total_duration
end

def self.sanitize(text, pantographer_id = nil)
text = text.truncate(Constant.pantography.max_length, omission: '')
.gsub(/"|“|”|\‘|\’/, "'")
.gsub(/\&/, '+')
.gsub(/\[\{/, '(')
.gsub(/\]\}/, ')')
.downcase
.gsub(/[^#{ Constant.pantography.alphabet_escaped }]/, '')
if pantographer_id == self.pantography_twitter_user.id
text = self.spamify(text)
end
text
text = self.spamify(text) if pantographer_id == self.pantography_twitter_user.id
text.truncate(Constant.pantography.max_length, omission: '')
.gsub(/"|“|”|\‘|\’/, "'")
.gsub(/\&/, '+')
.gsub(/\[\{/, '(')
.gsub(/\]\}/, ')')
.downcase
.gsub(/[^#{ Constant.pantography.alphabet_escaped }]/, '')
end

def self.publish_next
Expand Down

0 comments on commit 295edee

Please sign in to comment.