This commit is contained in:
erwanlr
2020-07-18 13:35:53 +02:00
parent 981bcf5fa2
commit cba6e74b13
3 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,3 @@
comment-author:before,.comment-author:after,.widget-area:before,.widget-area:after,.widget:before,.widget:after {
/* Some style */
}