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
{{ message }}
Repository navigation
Frontend: LiteSpeed's minifier cuts a regex in half and stops every combined script for visitors #2056
On the testing site, the verification page's device test (/valid/?ffc_device_check=1) stays at "Checking…" on every row for visitors who are not logged in, on phones and on desktop. A logged-in administrator sees it work.
Cause
LiteSpeed Cache minifies and combines scripts for guests. Its minifier, matthiasmullie/minify, mishandles a regex literal that ends in an escaped slash. When the literal is followed by ] or a line break, the minifier treats the closing slash as the start of a comment and drops the rest of the line. The rendered output on the testing site shows it:
source: ['LINE', /Line\//]
minified: ['LINE',/Line\];var BRANDS=…
The combined file then fails to parse ("Invalid regular expression: missing /"), so no script in it runs. The literal came in with #2053. Two more literals of the same shape exist (ffc-core.js, ffc-preflight.js); their current neighbours happen to survive minification.
Acceptance criteria
No regex literal in assets/js/ ends in an escaped slash. The three existing ones are rewritten to \/\d or \/{2}.
Every readable script in assets/js/ and libs/js/ runs through matthiasmullie/minify and still parses (verified once, by hand).
A guard test refuses the shape, with a canary and an independent recount of the scanned files.
No regex literal in assets/js/ ends in an escaped slash any more. The three that did (ffc-device-check.js, ffc-core.js, ffc-preflight.js) now end in \/\d or \/{2}.
Every readable and minified script in assets/js/ and libs/js/ (232 files) was run through matthiasmullie/minify and still parses.
MinifierSafeRegexTest refuses the shape, with a canary and a scandir recount.
The CHANGELOG entry is under Fixed.
On the testing site, purge the LiteSpeed JS cache after the deploy so the broken combined file is rebuilt.
Activity
fix(frontend): no regex literal ends in an escaped slash (#2057)
rpgmem commentedon Oct 24, 2026
Delivered in #2057 (merged to
develop):assets/js/ends in an escaped slash any more. The three that did (ffc-device-check.js,ffc-core.js,ffc-preflight.js) now end in\/\dor\/{2}.assets/js/andlibs/js/(232 files) was run through matthiasmullie/minify and still parses.MinifierSafeRegexTestrefuses the shape, with a canary and ascandirrecount.On the testing site, purge the LiteSpeed JS cache after the deploy so the broken combined file is rebuilt.
Generated by Claude Code