Skip to content

Commit df38a91

Browse files
committed
Be nice and parse JSON for the error
1 parent befe224 commit df38a91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/auxiliary/scanner/http/wordpress_content_injection.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ def do_update
136136
post_url = full_uri(wordpress_url_post(post[:id]))
137137

138138
if res && res.code == 200
139-
print_good("SUCCESS: #{post_url} (post updated)")
140-
elsif res && res.code == 404
141-
print_error("FAILURE: #{post_url} (invalid post ID)")
139+
print_good("SUCCESS: #{post_url} (Post updated)")
140+
elsif res && (error = res.get_json_document['message'])
141+
print_error("FAILURE: #{post_url} (#{error})")
142142
else
143-
print_error("FAILURE: #{post_url} (unknown error)")
143+
print_error("FAILURE: #{post_url} (Unknown error)")
144144
end
145145
end
146146
end

0 commit comments

Comments
 (0)