Repository navigation
Fix escaping in JUnit and GitHub Actions output formats - #165
Open
DaveLiddament wants to merge 1 commit into
Open
DaveLiddament wants to merge 1 commit into
DaveLiddament wants to merge 1 commit into
Conversation
JUnit: - Characters that are not valid in XML 1.0 (e.g. control characters in a violation message) are now removed. SimpleXML wrote them to the attribute unescaped and DOMDocument::loadXML() then failed, silently producing a report containing only an XML declaration. - The return value of loadXML() is now checked. GitHub Actions: - Literal '%' and carriage returns in messages are now escaped (the Actions runner URL decodes %25/%0D/%0A, so unescaped '%' sequences corrupted annotations and bare CRs truncated them). - The file property is now escaped as a workflow command property (a path containing ',' or ':' terminated the property list).
DaveLiddament
force-pushed
the
fix/output-formatter-escaping
branch
from
November 6, 2026 14:47
28efb5f to
c7690a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JUnit
A violation message containing an XML-1.0-invalid character (e.g.
\x08) produced a "report" consisting solely of<?xml version="1.0"?>— silent data loss. SimpleXML happily writes such characters into attributes, andDOMDocument::loadXML()'s failure was never checked.loadXML()'s return value is now checked (throwsSarbExceptioninstead of silently continuing).GitHub Actions
Escaping now follows the workflow-command rules:
%→%25and\r→%0Dadded (previously only\nwas escaped). The Actions runner URL-decodes these sequences, so a literal%0A/%25in a message was corrupted, and a bare CR truncated the annotation.file=property: fully escaped — a path containing,or:previously terminated the property list.Notes
title=property to the github format with its ownescapeProperty()— whichever merges second needs a small rebase (resolution: keep both,titleusesescapeProperty()).composer cipasses (100% coverage, PHPStan max, cs-fixer). New tests cover control characters, invalid UTF-8, and property/message escaping.