Repository navigation
fix(frontend): no regex literal ends in an escaped slash - #2057
Merged
Merged
Conversation
LiteSpeed Cache minifies and combines scripts for guests through matthiasmullie/minify. That minifier reads a regex literal ending in an escaped slash, followed by `]` or a line break, as closing early and drops the rest of the line. `['LINE', /Line\//]` (#2053) came out as `['LINE',/Line\];`, the combined file stopped parsing, and the device test stayed at "Checking…" for every visitor who is not logged in. The three such literals become `\/\d` and `\/{2}`. Every readable and minified script in assets/js and libs/js was run through the same minifier and still parses. MinifierSafeRegexTest refuses the shape, with a canary and an independent recount of the scanned files. Closes #2056 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
rpgmem
marked this pull request as ready for review
October 24, 2026 12:50
rpgmem
enabled auto-merge (squash)
October 24, 2026 12:50
4 tasks
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.
Closes #2056
Problem
On the testing site,
/valid/?ffc_device_check=1stays at "Checking…" on every row for visitors who are not logged in, on phones and on desktop. A logged-in administrator sees it work.LiteSpeed Cache minifies and combines scripts for guests through matthiasmullie/minify. That minifier misreads a regex literal that ends in an escaped slash when it is followed by
]or a line break: it closes the literal early and drops the rest of the line. The combined file on the site has['LINE',/Line\];var BRANDS=…, from['LINE', /Line\//](#2053). The file stops parsing ("Invalid regular expression: missing /"), so no script in it runs.Change
The three literals of that shape now end in
\/\dor\/{2}:ffc-device-check.js;ffc-core.js(the in-app browser check);ffc-preflight.js(the Android "open in Chrome" link).The last two survive the minifier today only because of the character that follows them.
MinifierSafeRegexTestrefuses a regex literal ending in an escaped slash inassets/js/. The rule is wider than the measured trigger on purpose: which characters may follow the literal safely is the minifier's business.Tests
assets/js/*.jsandlibs/js/*.js, 118 files) and every*.min.js(114) goes through that minifier and still parses (node --check).MinifierSafeRegexTest:scandirrecount checks that it reads every script.Line/14.13.0) still detects LINE.Checklist
develop; no version bumpCHANGELOG.md— one bullet at the end of Fixed, citing the issueGenerated by Claude Code