Harden directive/filter edge-case handling and add executable edge matrix coverage#3
Draft
Copilot wants to merge 6 commits into
Draft
Conversation
Copilot created this pull request from a session on behalf of
beobles
June 2, 2026 23:14
View session
…ache mod_php false positives
Copilot
AI
changed the title
refactor: drop
fix(Renderer): prevent Apache mod_php output from triggering false SyntaxException
Jun 2, 2026
Beobles\ namespace prefix + round-2 bug/security fixes
Copilot
AI
changed the title
fix(Renderer): prevent Apache mod_php output from triggering false SyntaxException
Harden template lint execution and make string filters UTF-8 safe
Jun 2, 2026
Copilot
AI
changed the title
Harden template lint execution and make string filters UTF-8 safe
Harden directive/filter edge-case handling and add executable edge matrix coverage
Jun 2, 2026
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.
The engine still had edge-case failures in directive/filter parsing, especially around
{{ ... }}expressions in attributes and filter chains containing literal pipes. This PR hardens lexer/compiler/filter behavior and adds a focused edge-case matrix to prevent regressions across directives and core filters.Lexer tag extraction robustness
Lexer::extractTagnow tracks mustache depth while scanning tags.>appears inside{{ ... }}(e.g. array syntax with=>in<Include data={{ ... }}>).Filter-chain parsing correctness
Compiler::compileExpressionnow uses a delimiter-aware splitter for|.join(" | ")).String/array filter hardening
StringFilters: safer UTF-8-aware truncation helpers with non-mbstringfallbacks.FilterRegistry::reverse: multibyte-safe string reverse whenmb_*is available.ArrayFilters::join: stable handling for non-scalar elements via deterministic stringification.ArrayFilters::json: partial-output mode to avoid hard failures on non-encodable segments.Edge-case matrix for directives + filters
examples/edge_matrix.phpwith executable scenarios covering:If/ElseIf/Else,Foreachloop metadata,Set,Includewith expression data,BlockDocs