Merge pull request #830 from mrnfrancesco/fix-issue-815

Fix issue 815
This commit is contained in:
Ryan Dewhurst
2015-06-04 09:46:26 +02:00
2 changed files with 13 additions and 4 deletions

View File

@@ -79,11 +79,18 @@ def missing_db_file?
false
end
def last_update
date = nil
if File.exists?(LAST_UPDATE_FILE)
content = File.read(LAST_UPDATE_FILE)
date = Time.parse(content) rescue nil
end
date
end
def update_required?
return true unless File.exist?(LAST_UPDATE_FILE)
content = File.read(LAST_UPDATE_FILE)
date = Time.parse(content) rescue Time.parse("2000-01-01")
return date < 5.days.ago
date = last_update
(true if date.nil?) or (date < 5.days.ago)
end
# Define colors

View File

@@ -39,6 +39,8 @@ def main
if wpscan_options.version
puts "Current version: #{WPSCAN_VERSION}"
date = last_update
puts "Last DB update: #{date.strftime('%Y-%m-%d')}" unless date.nil?
exit(0)
end