Fixes #1313
This commit is contained in:
@@ -16,7 +16,7 @@ module WPScan
|
|||||||
|
|
||||||
return if target.content_dir
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -19,4 +19,10 @@ module WPScan
|
|||||||
'The WordPress version is invalid'
|
'The WordPress version is invalid'
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|||||||
@@ -22,12 +22,8 @@ describe WPScan::Controller::CustomDirectories do
|
|||||||
context 'when the content_dir is not found and not supply' do
|
context 'when the content_dir is not found and not supply' do
|
||||||
before { expect(controller.target).to receive(:content_dir) }
|
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
|
it 'raises an exception' do
|
||||||
expect { controller.before_scan }.to raise_error(exception)
|
expect { controller.before_scan }.to raise_error(WPScan::WpContentDirNotDetected)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user