app/controllers/application_controller.rb
# Safe #to_sym conversion to avoid DOS-attacks by creating ludicrous amounts of Symbols.
Safe #to_sym conversion to avoid DOS-attacks by creating ludicrous amounts of Symbols.
Safe #to_sym conversion to avoid DOS - attacks by creating ludicrous amounts of Symbols .
def to_safe_sym( value, valid_values )
    symbolized = nil
    valid_values.each do |v|
      if v == value
         symbolized = v.to_sym
        break
      end
    end
    symbolized
  end
def to_safe_sym ( value , valid_values ) symbolized = nil valid_values . each do | v | if v == value symbolized = v . to_sym break end end symbolized end
Safe #to_sym conversion to avoid DOS-attacks by creating ludicrous amounts of Symbols.
Safe #to_sym conversion to avoid DOS - attacks by creating ludicrous amounts of Symbols .
value
<not_specific>
valid_values
<not_specific>