Fixes the remove_conditional_comments function
This commit is contained in:
@@ -74,7 +74,7 @@ def add_trailing_slash(url)
|
||||
end
|
||||
|
||||
def remove_conditional_comments(text)
|
||||
text.gsub(/<!--\[if[^>]+>(.*)<!\[end[^>]+>/im, '\1')
|
||||
text.gsub(/\<\!--\[if[^>]+>(.*?)\<\!\[end[^>]+>/im, '\1')
|
||||
end
|
||||
|
||||
# loading the updater
|
||||
|
||||
@@ -18,7 +18,7 @@ describe WpItems do
|
||||
vulnerable_targets_items: [ WpItem.new(uri, name: 'mr-smith'),
|
||||
WpItem.new(uri, name: 'neo')],
|
||||
|
||||
passive_detection: (1..14).reduce(WpItems.new) { |o, i| o << WpItem.new(uri, name: "detect-me-#{i}") }
|
||||
passive_detection: (1..15).reduce(WpItems.new) { |o, i| o << WpItem.new(uri, name: "detect-me-#{i}") }
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,31 +22,36 @@
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://example.com/wp-content/items/detect-me-6/assets/js/vendor/html5shiv.js"></script>
|
||||
<![endif]-->
|
||||
<!--[if IE 8]>
|
||||
<link rel="stylesheet" type="text/css" href="https://example.com/wp-content/items/detect-me-7/" />
|
||||
<![endif]-->
|
||||
|
||||
<style type="text/css">
|
||||
#fancybox-loading.fancybox-ie div {
|
||||
background: transparent;
|
||||
filter: AlphaImageLoader(src='http://example.com/wp-content/items/detect-me-7/fancybox/fancy_loading.png', sizingMethod='scale');
|
||||
filter: AlphaImageLoader(src='http://example.com/wp-content/items/detect-me-8/fancybox/fancy_loading.png', sizingMethod='scale');
|
||||
}
|
||||
</style>
|
||||
|
||||
<style type="text/css" media="all">
|
||||
/* <![CDATA[ */
|
||||
@import url("https://example.com/wp-content/items/detect-me-8/css/plugin.css?ver=1.9.4");
|
||||
@import url('/wp-content/items/detect-me-9/css/datatables.css?ver=1.9.4');
|
||||
@import url(/wp-content/items/detect-me-10/css/datatables.css?ver=1.9.4);
|
||||
@import url(//wp-content/items/detect-me-11/css/datatables.css?ver=1.9.4);
|
||||
@import url("https://example.com/wp-content/items/detect-me-9/css/plugin.css?ver=1.9.4");
|
||||
@import url('/wp-content/items/detect-me-10/css/datatables.css?ver=1.9.4');
|
||||
@import url(/wp-content/items/detect-me-11/css/datatables.css?ver=1.9.4);
|
||||
@import url(//wp-content/items/detect-me-12/css/datatables.css?ver=1.9.4);
|
||||
/* ]]> */
|
||||
</style>
|
||||
|
||||
<script type='text/javascript'>
|
||||
/* <![CDATA[ */
|
||||
var poll1 = {"ajax_url": "http:\/\/example.com\/wp-content\/items\/detect-me-12\/wp-polls.php", "text_wait": "Please wait a while ..."};
|
||||
var poll2 = {"ajax_url": "\/wp-content\/items\/detect-me-13\/wp-polls.php", "text_wait": "Please wait a while ..."};
|
||||
var poll3 = {"ajax_url": "\/\/wp-content\/items\/detect-me-14\/wp-polls.php", "text_wait": "Please wait a while ..."};
|
||||
var poll1 = {"ajax_url": "http:\/\/example.com\/wp-content\/items\/detect-me-13\/wp-polls.php", "text_wait": "Please wait a while ..."};
|
||||
var poll2 = {"ajax_url": "\/wp-content\/items\/detect-me-14\/wp-polls.php", "text_wait": "Please wait a while ..."};
|
||||
var poll3 = {"ajax_url": "\/\/wp-content\/items\/detect-me-15\/wp-polls.php", "text_wait": "Please wait a while ..."};
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<!--[if IE 8]><link rel="stylesheet" type="text/css" href="https://example.com/ie8.css" /><![endif]-->
|
||||
|
||||
<!-- Items that should not be detected -->
|
||||
http://example.com/wp-content/items/this-should-not-match/sub.css
|
||||
href="http://example.com/wp-content/items/this-should-not-match/sub.css"
|
||||
|
||||
Reference in New Issue
Block a user