Skip to content

fix(weixin): MEDIA tag regex now covers .md, .json, .yaml, .yml, .toml, .log#32611

Closed
wali-reheman wants to merge 1 commit into
NousResearch:mainfrom
wali-reheman:fix/upstream-weixin-media-tag-leak
Closed

fix(weixin): MEDIA tag regex now covers .md, .json, .yaml, .yml, .toml, .log#32611
wali-reheman wants to merge 1 commit into
NousResearch:mainfrom
wali-reheman:fix/upstream-weixin-media-tag-leak

Conversation

@wali-reheman

Copy link
Copy Markdown
Contributor

weixin MEDIA tags for .md/.json/.yaml/.yml/.toml/.log were leaking as raw text instead of being extracted as file attachments — the regex whitelist didn't include them. fixes #32601

….yml, .toml, .log

These common file types were silently leaking as raw text on WeChat because the
MEDIA tag regex didn't recognize them. Fixes NousResearch#32601.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have platform/wecom WeCom / WeChat Work adapter labels May 26, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #29609 which derives the extension allowlist dynamically from SUPPORTED_DOCUMENT_TYPES instead of hardcoding. Part of a saturated cluster of 5+ competing PRs (#22492, #30588, #32398, #32604, #32358). Also see #32601 (the issue this fixes) which was already triaged as part of the same cluster.

@teknium1

Copy link
Copy Markdown
Contributor

Superseded by #34844, which consolidates this cluster.

This PR widens the extract_media extension allowlist, which is the right direction — but on its own it leaves the unconditional MEDIA:\s*\S+ strip in place, so a MEDIA: tag with any extension still outside the (now wider) list keeps getting deleted from the body before extract_local_files can pick up the bare path. #34844 fixes both halves: it unifies the two extractors onto a single shared extension set (MEDIA_DELIVERY_EXTS) AND replaces the loose strip with an extension-anchored one, so an unknown-extension path survives in the text instead of vanishing.

Closing as superseded — thanks for surfacing and helping pin down this bug; it was part of getting the full fix right. See #34844.

@teknium1 teknium1 closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have platform/wecom WeCom / WeChat Work adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(weixin): MEDIA tag leaks for .md/.json/.yaml/.toml/.log files + no retry on session expiry

3 participants