Skip to content

FIXED: Catastrophic backtracking in regular expression if the current…#1779

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
hernst42:master
Jul 29, 2019
Merged

FIXED: Catastrophic backtracking in regular expression if the current…#1779
TomasVotruba merged 1 commit intorectorphp:masterfrom
hernst42:master

Conversation

@hernst42
Copy link
Copy Markdown
Contributor

… text pattern contains lot of white spaces
I got the following error with one of my Doc-Blocks:
Backtrack limit was exhausted (pattern: #\+\-\-\-\-\+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\s+\+\=\=\=\=\+#s)". On line: 2

Example Doc-Block which caused an issue:

   /**
     * format:
     *      current matrix:               layout:
     *      +----+                        +====+
     *      |    |                        X    X
     *      +    +                        +    +
     *      |    |                        X    X
     *      +    +                        +====+
     *      |    |                        X    X
     *      +    +                        +    +
     *      |    |                        X    X
     *      +----+                        +====+
     *
     * @return TableLayout
     */ 

The attached change should have the same pattern matching semantic.

@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit d075842 into rectorphp:master Jul 29, 2019
TomasVotruba added a commit that referenced this pull request Feb 8, 2022
rectorphp/rector-src@ea69b90 [PhpSpecToPHPUnit] Clean up unnecessary check already renamed to test (#1779)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants