4info 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/4info.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{4info}
8
- s.version = "1.3.1"
8
+ s.version = "1.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Danger Canty"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
data/lib/contactable.rb CHANGED
@@ -132,6 +132,10 @@ module FourInfo
132
132
  self.class :
133
133
  FourInfo).confirmation_message(confirmation_code)
134
134
 
135
+ if message.to_s.size > 160
136
+ raise ArgumentError, "SMS Confirmation Message is too long. Limit it to 160 characters of unescaped text."
137
+ end
138
+
135
139
  response = FourInfo::Request.new.deliver_message(message, four_info_sms_phone_number)
136
140
 
137
141
  if response.success?
data/lib/four_info.rb CHANGED
@@ -32,7 +32,7 @@ module FourInfo
32
32
  end
33
33
 
34
34
  def confirmation_message(confirmation_code)
35
- "4INFO alert confirm. code: #{confirmation_code} Enter code on web to verify phone. Msg&data rates may apply. Freq set by u. T&C & support at www.4info.com. Txt HELP for help"
35
+ "4INFO alert confirm. code: #{confirmation_code} Enter code on web to verify phone. Msg&data rates may apply. Freq set by u. T&C & support at www.4info.com. Txt HELP for help"
36
36
  end
37
37
 
38
38
  def generate_confirmation_code
data/lib/request.rb CHANGED
@@ -38,6 +38,7 @@ module FourInfo
38
38
 
39
39
  def template(name)
40
40
  # Haml templates for XML
41
+ require 'cgi'
41
42
  templates = Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), 'templates', '*.haml')))
42
43
  file = templates.detect {|t| File.basename(t).chomp('.haml').to_sym == name.to_sym }
43
44
  raise ArgumentError, "Missing 4Info template: #{name}" unless file
@@ -71,4 +72,4 @@ module FourInfo
71
72
  end
72
73
  end
73
74
  end
74
- end
75
+ end
@@ -8,4 +8,4 @@
8
8
  %recipient
9
9
  %type= 5
10
10
  %id= number
11
- %text= message
11
+ %text= CGI.escape message
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 4info
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty