Fix #397 WP 3.8.1 Fingerprint
This commit is contained in:
@@ -10,6 +10,12 @@
|
|||||||
<wp-versions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<wp-versions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="wp_versions.xsd">
|
xsi:noNamespaceSchemaLocation="wp_versions.xsd">
|
||||||
|
|
||||||
|
<file src="wp-includes/css/buttons-rtl.css">
|
||||||
|
<hash md5="fb062ed92b76638c161e80f4a5426586">
|
||||||
|
<version>3.8.1</version>
|
||||||
|
</hash>
|
||||||
|
</file>
|
||||||
|
|
||||||
<file src="wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js">
|
<file src="wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js">
|
||||||
<hash md5="4de9f6b1aafe968e8509ffe7ee9bc973">
|
<hash md5="4de9f6b1aafe968e8509ffe7ee9bc973">
|
||||||
<version>3.8</version>
|
<version>3.8</version>
|
||||||
|
|||||||
Binary file not shown.
@@ -50,7 +50,7 @@ def download_and_unzip_version(version, dest)
|
|||||||
dest_zip = "/tmp/wp-#{version}.zip"
|
dest_zip = "/tmp/wp-#{version}.zip"
|
||||||
|
|
||||||
download(wp_version_zip_url(version), dest_zip)
|
download(wp_version_zip_url(version), dest_zip)
|
||||||
|
|
||||||
if $?.exitstatus === 0 and File.exists?(dest_zip)
|
if $?.exitstatus === 0 and File.exists?(dest_zip)
|
||||||
if file_md5(dest_zip) === wp_version_zip_md5(version)
|
if file_md5(dest_zip) === wp_version_zip_md5(version)
|
||||||
remove_dir("#{dest}/wordpress/")
|
remove_dir("#{dest}/wordpress/")
|
||||||
@@ -63,7 +63,7 @@ def download_and_unzip_version(version, dest)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
raise 'Download error'
|
raise 'Download error'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def unzip(zip_path, dest)
|
def unzip(zip_path, dest)
|
||||||
@@ -164,7 +164,7 @@ if @update
|
|||||||
db_path = Path.first_or_create(value: file_path)
|
db_path = Path.first_or_create(value: file_path)
|
||||||
fingerprint = Fingerprint.create(path_id: db_path.id, md5_hash: hash)
|
fingerprint = Fingerprint.create(path_id: db_path.id, md5_hash: hash)
|
||||||
|
|
||||||
|
|
||||||
db_version.fingerprints << fingerprint
|
db_version.fingerprints << fingerprint
|
||||||
end
|
end
|
||||||
db_version.save
|
db_version.save
|
||||||
@@ -176,9 +176,9 @@ end
|
|||||||
|
|
||||||
if @version
|
if @version
|
||||||
if version = Version.first(number: @version)
|
if version = Version.first(number: @version)
|
||||||
repository(:default).adapter.select('SELECT md5_hash, path_id, version_id, paths.value AS path FROM fingerprints LEFT JOIN paths ON path_id = id GROUP BY md5_hash ORDER BY path ASC').each do |f|
|
repository(:default).adapter.select('SELECT md5_hash, path_id, version_id, paths.value AS path FROM fingerprints LEFT JOIN paths ON path_id = id WHERE md5_hash NOT IN (SELECT DISTINCT md5_hash FROM fingerprints WHERE version_id != ?) ORDER BY path ASC', version.id).each do |f|
|
||||||
if f.version_id == version.id
|
if f.version_id == version.id
|
||||||
puts "#{f.md5_hash} #{f.path}"
|
puts "#{f.md5_hash} #{f.path}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -207,7 +207,7 @@ end
|
|||||||
|
|
||||||
if @target_url
|
if @target_url
|
||||||
uri = URI.parse(@target_url)
|
uri = URI.parse(@target_url)
|
||||||
|
|
||||||
Version.all(order: [ :number.desc ]).each do |version|
|
Version.all(order: [ :number.desc ]).each do |version|
|
||||||
total_urls = version.fingerprints.count
|
total_urls = version.fingerprints.count
|
||||||
matches = 0
|
matches = 0
|
||||||
@@ -215,7 +215,7 @@ if @target_url
|
|||||||
|
|
||||||
version.fingerprints.each do |f|
|
version.fingerprints.each do |f|
|
||||||
url = uri.merge(f.path.value).to_s
|
url = uri.merge(f.path.value).to_s
|
||||||
|
|
||||||
if web_page_md5(url) == f.md5_hash
|
if web_page_md5(url) == f.md5_hash
|
||||||
matches += 1
|
matches += 1
|
||||||
puts "#{url} matches v#{version.number}" if @verbose
|
puts "#{url} matches v#{version.number}" if @verbose
|
||||||
@@ -225,7 +225,7 @@ if @target_url
|
|||||||
|
|
||||||
print("Version #{version.number} [#{matches}/#{total_urls} #{percent}% matches]\r")
|
print("Version #{version.number} [#{matches}/#{total_urls} #{percent}% matches]\r")
|
||||||
end
|
end
|
||||||
|
|
||||||
puts
|
puts
|
||||||
|
|
||||||
if percent == 100.0
|
if percent == 100.0
|
||||||
|
|||||||
Reference in New Issue
Block a user