bugfixing
This commit is contained in:
@@ -91,10 +91,14 @@ class WpTarget
|
|||||||
unless @wp_content_dir
|
unless @wp_content_dir
|
||||||
index_body = Browser.instance.get(@uri.to_s).body
|
index_body = Browser.instance.get(@uri.to_s).body
|
||||||
|
|
||||||
if index_body[%r{/wp-content/(?:themes|plugins)/}i]
|
if index_body[%r{#@uri/?wp-content/(?:themes|plugins)/}i]
|
||||||
@wp_content_dir = "wp-content"
|
@wp_content_dir = "wp-content"
|
||||||
else
|
else
|
||||||
@wp_content_dir = index_body[%r{(?:href|src)=(?:"|')#{@uri}/?([^"']+)/(?:themes|plugins)/.*(?:"|')}i, 1]
|
@wp_content_dir = index_body[%r{(?:href|src)=(?:"|')#@uri/?([^"']+)/(?:themes|plugins)/.*(?:"|')}i, 1]
|
||||||
|
# Bug: Some themes and plugins render incorrect with custom wp-content dir, so only take the first folder
|
||||||
|
# Exmaple:
|
||||||
|
# /wordpress/wp-custom/plugins/usr/share/wordpress/wp-content/plugins/contact-form-7/includes/js/jquery.form.js?
|
||||||
|
@wp_content_dir = @wp_content_dir[%r{([^/]+).*}i, 1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@wp_content_dir
|
@wp_content_dir
|
||||||
|
|||||||
Reference in New Issue
Block a user