Skip to content

Commit

Permalink
XDG Support for wpscan db
Browse files Browse the repository at this point in the history
  • Loading branch information
alichtman committed Apr 29, 2023
1 parent fb81255 commit d7c4053
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/wpscan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ module WPScan
include CMSScanner

APP_DIR = Pathname.new(__FILE__).dirname.join('..', 'app').expand_path
DB_DIR = Pathname.new(Dir.home).join('.wpscan', 'db')

# XDG support for DB_DIR
legacy_path = Pathname.new(Dir.home).join('.wpscan', 'db')
xdg_path = Pathname.new(ENV['XDG_CACHE_HOME'] || Dir.home.join('.cache')).join('wpscan', 'db')
if legacy_path.exist?
DB_DIR = legacy_path
else
DB_DIR = xdg_path
end

Typhoeus.on_complete do |response|
next if response.cached? || !response.from_vuln_api?
Expand Down

0 comments on commit d7c4053

Please sign in to comment.