3 class ShellsafeValidator
4 def self.validate(validator)
5 raise ValidatorError, "value should be a String" unless validator.is_a?(String)
7 ['`', '$', ';', '|', '&&', '>', '<'].each do |chr|
8 raise ValidatorError, "value should not have #{chr} in it" if validator.match(Regexp.escape(chr))