Fixes #1520
This commit is contained in:
@@ -101,7 +101,7 @@ module WPScan
|
||||
#
|
||||
# @return [ String ]
|
||||
def parse_style_tag(body, tag)
|
||||
value = body[/#{Regexp.escape(tag)}:[\t ]*([^\r\n*]+)/i, 1]
|
||||
value = body[/\b#{Regexp.escape(tag)}:[\t ]*([^\r\n*]+)/, 1]
|
||||
|
||||
value && !value.strip.empty? ? value.strip : nil
|
||||
end
|
||||
|
||||
@@ -41,6 +41,12 @@ describe WPScan::Model::Theme do
|
||||
its(:style_uri) { should eql 'http://www.elegantthemes.com/gallery/divi/' }
|
||||
its(:license_uri) { should eql 'http://www.gnu.org/licenses/gpl-2.0.html' }
|
||||
end
|
||||
|
||||
context 'when no tags' do
|
||||
let(:fixture) { fixtures.join('no_tags.css') }
|
||||
|
||||
its(:author) { should eql nil }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#version' do
|
||||
|
||||
3
spec/fixtures/models/theme/no_tags.css
vendored
Normal file
3
spec/fixtures/models/theme/no_tags.css
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
comment-author:before,.comment-author:after,.widget-area:before,.widget-area:after,.widget:before,.widget:after {
|
||||
/* Some style */
|
||||
}
|
||||
Reference in New Issue
Block a user