Change BeEF::Filters::is_valid_yes_no to be case insensitive

This commit is contained in:
Brendan Coles
2016-03-20 16:33:57 +00:00
parent 6eccbbe1a6
commit 264c203a7e

View File

@@ -192,11 +192,9 @@ module Filters
# Verify the yes and no is valid
# @param [String] str String for testing
# @return [Boolean] If the string is either 'yes' or 'no'
# @todo Confirm this is case insensitive
def self.is_valid_yes_no?(str)
return false if has_non_printable_char?(str)
return false if str !~ /^(Yes|No)$/
return false if str.length > 200
return false if str !~ /\A(Yes|No)\z/i
true
end