You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#160: Anchor IsJSON regex to prevent false positives on CDATA
The IsJSON() function was using an unanchored regex `\s*[{\[]` which
would match a `[` character anywhere in the input. This caused XML
documents containing CDATA sections like `<![CDATA[text]]>` to be
incorrectly detected as JSON.
Changed the regex to `^\s*[{\[]` to anchor it to the start of the
input string. Now only inputs that actually begin with `{` or `[`
(after optional whitespace) will be detected as JSON.
Added TestIsJSON with test cases including CDATA to verify the fix.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments