lib/nessus/report_item.rb in dradis-nessus-4.6.0 vs lib/nessus/report_item.rb in dradis-nessus-4.7.0
- old
+ new
@@ -85,11 +85,12 @@
# cvss_base_score, plugin_output, plugin_version, exploitability_ease,
# vuln_publication_date, exploit_framework_canvas,
# exploit_framework_metasploit, exploit_framework_core
tag = @xml.xpath("./#{method_name}").first
if tag
- return tag.text
+ text = tag.text
+ return tags_with_html_content.include?(method) ? cleanup_html(text) : text
end
# then the custom XML tags (cm: namespace)
if method_name.starts_with?('cm_')
method_name = method_name.sub(/cm_/, 'cm:compliance-').gsub(/_/, '-')
@@ -115,7 +116,20 @@
else
# nothing found, the tag is valid but not present in this ReportItem
return nil
end
end
+
+ private
+
+ def cleanup_html(source)
+ result = source.dup
+ result.gsub!(/<code>(.*?)<\/code>/) { "\n\nbc. #{$1}\n\np. \n" }
+ result
+ end
+
+ def tags_with_html_content
+ [:description]
+ end
+
end
-end
\ No newline at end of file
+end