This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
module SafeYAML
|
||||
class Parse
|
||||
class Hexadecimal
|
||||
MATCHER = /\A[-+]?0x[0-9a-fA-F_]+\Z/.freeze
|
||||
|
||||
def self.value(value)
|
||||
# This is safe to do since we already validated the value.
|
||||
return Integer(value.gsub(/_/, ""))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user