Fixed false positive theme detection

This commit is contained in:
Christian Mehlmauer
2014-07-16 18:25:35 +02:00
parent 102e30c29a
commit 6ebb9b6f66
6 changed files with 50 additions and 22 deletions

View File

@@ -30,13 +30,13 @@ class WpTheme < WpItem
response = Browser.get_and_follow_location(target_uri.to_s)
# https + domain is optional because of relative links
matches = %r{(?:https?://[^"']+)?/([^/]+)/themes/([^"']+)/style.css}i.match(response.body)
matches = /(?:https?:\/\/[^"']+)?\/([^\/]+)\/themes\/([^"'\/]+)[^"']*\/style.css/i.match(response.body)
if matches
return new(
target_uri,
{
name: matches[2],
style_url: matches[0],
additional_url: matches[0],
wp_content_dir: matches[1]
}
)