lib/ImportSupport.rb
## Iterate over each value and strip any Dangerous SQL
## hash :key sanitation happens w/ a merge later on
Iterate over each value and strip any Dangerous SQL
hash :key sanitation happens w/ a merge later on
Iterate over each value and strip any Dangerous SQL hash : key sanitation happens w / a merge later on
def sanitize_row(record)
    cleaned_record = {}
    record.each_pair do |k, v| 
      cleaned_record.store(k,
                           v.to_s.gsub(/\//i, '-').gsub(/[^ [:word:]\-\. ]/i, ''))
    end
    cleaned_record
  end
def sanitize_row ( record ) cleaned_record = { } record . each_pair do | k , v | cleaned_record . store ( k , v . to_s . gsub ( / \/ /i , '-' ) . gsub ( / [^ [:word:] \- \.  ] /i , '' ) ) end cleaned_record end
Iterate over each value and strip any Dangerous SQL
hash :key sanitation happens w/ a merge later on
Iterate over each value and strip any Dangerous SQL hash : key sanitation happens w / a merge later on
# this might remove too much info... # first exchanges \ for - then removes everything not[^ ] :word or - or . or space # put sql problem chars here only.gsub(/\W+/, ""))
record