This commit is contained in:
erwanlr
2018-01-30 19:59:41 +00:00
parent 9c7188a312
commit 1499b07176
4 changed files with 112 additions and 3 deletions

View File

@@ -168,11 +168,14 @@ class WpVersion < WpItem
#
# @return [ String ] The version number
def find_from_readme(target_uri)
scan_url(
version = scan_url(
target_uri,
%r{<br />\sversion #{version_pattern}}i,
'readme.html'
)
# Since WP >= 4.7, the Readme only contains the major version
VersionCompare.lesser?(version, '4.7') ? version : nil
end
# Attempts to find the WordPress version from the sitemap.xml file.