Skip to content

fix: escape </script at the end of a serialized function body - #235

Merged
redonkulus merged 1 commit into
mainfrom
fix/script-close-end-of-body
Oct 22, 2026
Merged

redonkulus merged 1 commit into
mainfrom
fix/script-close-end-of-body

Conversation

@redonkulus

Copy link
Copy Markdown
Collaborator

escapeFunctionBody() escapes each function body on its own, so a body ending in a bare </script never saw the delimiter that the surrounding output supplies next (e.g. the newline from the space option). The sequence was emitted raw, letting a later value close the tag and inject markup. Also match the bare form at end of string.

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

`escapeFunctionBody()` escapes each function body on its own, so a body
ending in a bare `</script` never saw the delimiter that the surrounding
output supplies next (e.g. the newline from the `space` option). The
sequence was emitted raw, letting a later value close the tag and inject
markup. Also match the bare form at end of string.

Fixes PSECBUGS-118415.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant