Skip to content

Commit 00fc49b

Browse files
committed
plugging sql vulnerability in mysql2 adapter
1 parent 130c257 commit 00fc49b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/mysql2_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def quote(value, column = nil)
157157
end
158158

159159
def quote_column_name(name) #:nodoc:
160-
@quoted_column_names[name] ||= "`#{name}`"
160+
@quoted_column_names[name] ||= "`#{name.to_s.gsub('`', '``')}`"
161161
end
162162

163163
def quote_table_name(name) #:nodoc:

0 commit comments

Comments
 (0)