MYSQLSafe 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -78,9 +78,16 @@ module MYSQLSafe
78
78
 
79
79
  def match_name(name_array, sql)
80
80
  match = []
81
-
81
+ arrayable_sql = sql
82
+
82
83
  name_array.each do |name|
83
- match.push(name) if sql.to_s.include?("#{name}")
84
+ containing_characters = ["\"", "'", "`", ",", "(", ")", ".", "=", ";"]
85
+ containing_characters.each do |illegal|
86
+ arrayable_sql = arrayable_sql.gsub(illegal, ' ')
87
+ end
88
+ arrayable_sql.split(" ").each do |word|
89
+ match.push(name) if word == "#{name.strip}"
90
+ end
84
91
  end
85
92
 
86
93
  if match.size > 0
@@ -1,3 +1,3 @@
1
1
  module MYSQLSafe
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MYSQLSafe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-04 00:00:00.000000000 Z
12
+ date: 2013-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler