Commit Graph

4 Commits

Author SHA1 Message Date
Tom
e79e212912 fix(curriculum): helper function regex s flag causing error (#41910) 2021-04-23 22:59:33 +02:00
Mrugesh Mohapatra
ad9b1f89d8 fix(api, client): update Gatsby, webpack & related things (#41452)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-03-25 12:13:43 -07:00
Erik Krogh Kristensen
11dfe9274f fix catastrophic backtracking when removing HTML comments (#40223)
* fix catastrophic backtracking when removing HTML comments

The regexp `/<!--(.|\s)*?-->/g` can experience catastrophic backtracking while matching a string like `<!--                                           -- >` (notice how it does not end with `-->`).    

[You can see the catastrophic backtracking in action here](https://regex101.com/r/2jvwFi/1/debugger). 

This is because both `.` and `\s` matches the space character, and there are therefore a large number of possible ways for `(.|\s)*` to match a long sequence of spaces.  
The regexp evaluator is greedy, and the problem therefore only exists when the string does not match the regexp. 

The fix is simply to remove the ambiguity such that there is only one possible way for the regexp to match a sequence of white-space.

* Update client/src/utils/curriculum-helpers.js

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2020-11-12 08:20:34 -08:00
Hassaan Pasha
80438cac3e feat(client, learn): add helper functions for common validation operations (#38605)
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
2020-09-17 19:38:01 +05:30