File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,10 @@ private static function parseString(ParsingInput $input): string
270
270
}
271
271
} elseif ($ char === '" ' ) {
272
272
return $ output ;
273
- } elseif (!ctype_print ($ char )) {
273
+ } elseif (
274
+ !ctype_print ($ char )
275
+ || (PHP_OS_FAMILY === 'Darwin ' && mb_detect_encoding ($ char , ['ASCII ' ], true ) === false )
276
+ ) {
274
277
throw new ParseException ('Invalid character in string at position ' . ($ input ->position () - 1 ));
275
278
}
276
279
@@ -296,7 +299,10 @@ private static function parseDisplayString(ParsingInput $string): DisplayString
296
299
while (!$ string ->empty ()) {
297
300
$ char = $ string ->consumeChar ();
298
301
299
- if (!ctype_print ($ char )) {
302
+ if (
303
+ !ctype_print ($ char )
304
+ || (PHP_OS_FAMILY === 'Darwin ' && mb_detect_encoding ($ char , ['ASCII ' ], true ) === false )
305
+ ) {
300
306
throw new ParseException (
301
307
'Invalid character in display string at position ' . ($ string ->position () - 1 )
302
308
);
You can’t perform that action at this time.
0 commit comments