Rework DisclosureDate check to match core code
Framework core uses Date.parse, so many date formats are valid. There is no reason we shouldn't be using ISO 8601 dates.GSoC/Meterpreter_Web_Console
parent
a30403dbfe
commit
3dd47b34b0
|
@ -441,18 +441,10 @@ class Msftidy
|
||||||
|
|
||||||
# Check disclosure date format
|
# Check disclosure date format
|
||||||
if @source =~ /["']DisclosureDate["'].*\=\>[\x0d\x20]*['\"](.+)['\"]/
|
if @source =~ /["']DisclosureDate["'].*\=\>[\x0d\x20]*['\"](.+)['\"]/
|
||||||
d = $1 #Captured date
|
begin
|
||||||
|
Date.parse($1) #Captured date
|
||||||
# Flag if overall format is wrong
|
# Flag if overall format is wrong
|
||||||
if d =~ /^... (?:\d{1,2},? )?\d{4}$/
|
rescue ArgumentError
|
||||||
# Flag if month format is wrong
|
|
||||||
m = d.split[0]
|
|
||||||
months = [
|
|
||||||
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
|
||||||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
|
||||||
]
|
|
||||||
|
|
||||||
error('Incorrect disclosure month format') if months.index(m).nil?
|
|
||||||
else
|
|
||||||
error('Incorrect disclosure date format')
|
error('Incorrect disclosure date format')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue