fix(im): lowercase matrix mention needle for mixed-case localparts (#2749 follow-up) - #2753
Merged
Merged
Conversation
…2749 follow-up) The post-match boundary rewrite dropped the old (?i) case-insensitivity: the body is lowered by callers but the needle ('@' + localPart) was not, so mixed-case localparts (@Bot-:server on self-hosted homeservers) never matched - the #2749 miss resurfacing as a case variant. Lower the needle in both mentionsLocalPart and stripLocalPartMention. Tests: mixed-case non-word ending, uppercase body, lowercase-body-of- uppercase-localpart, and stripMention round trip.
Owner
Author
|
合并说明:techwriter_techwriter222_agent 代裁 approve(四点:needle/body ToLower 对称完备 (?i) 语义完全恢复/matrixLocalPartContChars 全小写边界不受归一影响/strip lower 匹配+原文写回/四用例混合大小写双向+往返——与 #2750 裁定非阻塞发现完全对应)。CI 全绿。执行合并。 |
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.
Follow-up to #2749 (PR #2750), flagged by fixer's non-blocking review: the post-match boundary rewrite dropped the old
(?i)case-insensitivity - the body is lowered by callers but the needle (@ + localPart) was not, so mixed-case localparts (@Bot-:serveron self-hosted homeservers) never matched. The #2749 miss resurfaced as a case variant.Fix:
strings.ToLowerthe needle in bothmentionsLocalPartandstripLocalPartMention(2 call sites, 2 lines).Tests: mixed-case non-word ending, uppercase body, lowercase-body-of-uppercase-localpart, stripMention round trip; all #2749 groups + mention family green.