Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

test-bot: better xml character filtering #50092

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Library/Homebrew/cmd/test-bot.rb
Expand Up @@ -917,8 +917,9 @@ def test_bot
testcase.add_attribute "time", step.time

if step.has_output?
# Remove invalid XML CData characters from step output.
output = step.output.delete("\000\a\b\e\f\x2\x1f")
# Remove invalid XML characters
# http://www.w3.org/TR/xml/#charsets
output = step.output.gsub(/[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]/, "")

if output.bytesize > BYTES_IN_1_MEGABYTE
output = "truncated output to 1MB:\n" \
Expand Down