Skip to content

Commit f84952f

Browse files
danielstokesGrahamCampbell
authored andcommitted
Fix PREG_JIT_STACKLIMIT_ERROR (#275)
without the asterisk it uses too much memory, silently ignoring anything that exceeds the limits.
1 parent fe2a5c2 commit f84952f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Loader.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,16 @@ protected function sanitiseVariableValue($name, $value)
226226
$quote = $value[0];
227227
$regexPattern = sprintf(
228228
'/^
229-
%1$s # match a quote at the start of the value
230-
( # capturing sub-pattern used
231-
(?: # we do not need to capture this
232-
[^%1$s\\\\] # any character other than a quote or backslash
233-
|\\\\\\\\ # or two backslashes together
234-
|\\\\%1$s # or an escaped quote e.g \"
235-
)* # as many characters that match the previous rules
236-
) # end of the capturing sub-pattern
237-
%1$s # and the closing quote
238-
.*$ # and discard any string after the closing quote
229+
%1$s # match a quote at the start of the value
230+
( # capturing sub-pattern used
231+
(?: # we do not need to capture this
232+
[^%1$s\\\\]* # any character other than a quote or backslash
233+
|\\\\\\\\ # or two backslashes together
234+
|\\\\%1$s # or an escaped quote e.g \"
235+
)* # as many characters that match the previous rules
236+
) # end of the capturing sub-pattern
237+
%1$s # and the closing quote
238+
.*$ # and discard any string after the closing quote
239239
/mx',
240240
$quote
241241
);

0 commit comments

Comments
 (0)