Skip to content

Commit

Permalink
Fixes #1313
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanlr committed Mar 17, 2019
1 parent 5088ece commit 57c99c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/custom_directories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def before_scan

return if target.content_dir

raise 'Unable to identify the wp-content dir, please supply it with --wp-content-dir'
raise WpContentDirNotDetected
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions lib/wpscan/errors/wordpress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ def to_s
'The WordPress version is invalid'
end
end

class WpContentDirNotDetected < Error
def to_s
'Unable to identify the wp-content dir, please supply it with --wp-content-dir'
end
end
end
6 changes: 1 addition & 5 deletions spec/app/controllers/custom_directories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
context 'when the content_dir is not found and not supply' do
before { expect(controller.target).to receive(:content_dir) }

let(:exception) do
'Unable to identify the wp-content dir, please supply it with --wp-content-dir'
end

it 'raises an exception' do
expect { controller.before_scan }.to raise_error(exception)
expect { controller.before_scan }.to raise_error(WPScan::WpContentDirNotDetected)
end
end

Expand Down

0 comments on commit 57c99c4

Please sign in to comment.