Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit f834979

Browse files
committed
Add new method to allow custom validation of content
1 parent a7f6b4f commit f834979

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/wpxf/wordpress/file_download.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ def export_path
6868
File.expand_path normalized_option_value('export_path')
6969
end
7070

71+
# Validate the contents of the requested file.
72+
# @param [String] the file contents.
73+
# @return [Boolean] true if valid.
74+
def validate_content(content)
75+
true
76+
end
77+
7178
# Run the module.
7279
# @return [Boolean] true if successful.
7380
def run
@@ -76,7 +83,7 @@ def run
7683
return false unless super
7784

7885
res = request_file
79-
return false unless validate_result(res)
86+
return false unless validate_result(res) && validate_content(res.body)
8087

8188
if export_path.nil?
8289
emit_success "Result: \n#{res.body}"

0 commit comments

Comments
 (0)