diff --git a/spec/fixtures/target/platform/wordpress/custom_directories/with_port.html b/spec/fixtures/target/platform/wordpress/custom_directories/with_port.html
new file mode 100644
index 00000000..e7c59418
--- /dev/null
+++ b/spec/fixtures/target/platform/wordpress/custom_directories/with_port.html
@@ -0,0 +1,16 @@
+
+
+
+
+ WordPress 4.0 | Just another WordPress site
+
+
+
+
+
+
+
+
+
+
+Skip to content
diff --git a/spec/shared_examples/target/platform/wordpress/custom_directories.rb b/spec/shared_examples/target/platform/wordpress/custom_directories.rb
index 1f0a8174..20a5d1c7 100644
--- a/spec/shared_examples/target/platform/wordpress/custom_directories.rb
+++ b/spec/shared_examples/target/platform/wordpress/custom_directories.rb
@@ -31,6 +31,16 @@ shared_examples 'WordPress::CustomDirectories' do
end
end
+ context 'when the target URL is invalid according to PublicSuffix and contains a port' do
+ let(:url) { 'http://wp-lab:82/aa' }
+
+ it 'returns wp-content when matches' do
+ stub_request(:get, target.url).to_return(body: File.read(fixtures.join('with_port.html')))
+
+ expect(target.content_dir).to eql 'wp-content'
+ end
+ end
+
context 'when not found via the homepage' do
before { stub_request(:get, target.url).to_return(body: '') }
diff --git a/wpscan.gemspec b/wpscan.gemspec
index c9d9bf01..775b58c4 100644
--- a/wpscan.gemspec
+++ b/wpscan.gemspec
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.executables = ['wpscan']
s.require_paths = ['lib']
- s.add_dependency 'cms_scanner', '~> 0.5.0'
+ s.add_dependency 'cms_scanner', '~> 0.5.1'
s.add_development_dependency 'bundler', '>= 1.6'
s.add_development_dependency 'coveralls', '~> 0.8.0'