JShrink
JShrink copied to clipboard
"Unclosed string at position: 2955" error processing moment.js Hebrew locale configuration
This examples causes an error "Unclosed string at position: 2955", referring to "יי" in the regex of the isPM function.
\JShrink\Minifier::minify(file_get_contents('https://raw.githubusercontent.com/moment/moment/develop/locale/he.js'));
I don't know any Hebrew, but as far as I can tell, the regex is valid.
Here's a simplified example with part of the regex from the script that is causing an error:
\JShrink\Minifier::minify('/^(")$/');
As far as I can tell, the problem is that JShrink processes scripts one byte at a time and therefore has problems with scripts containing multi-byte chars.
http://php.net/manual/en/book.mbstring.php