Skip to content

Commit

Permalink
Ignore long regex strings
Browse files Browse the repository at this point in the history
Ignore the regex on long strings and return the base string.
  • Loading branch information
misagh authored Oct 22, 2019
1 parent ffc87b0 commit 9161c89
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/KeywordStuffing.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,14 @@ private function removeAbnormalLines($lines, $text)

$replacement = $this->generateReplacement($pattern);

$text = preg_replace($pattern, $replacement, $text);

return $text;
try
{
$text = preg_replace($pattern, $replacement, $text);
}
finally
{
return $text;
}
}

private function removeEmptyLines($text)
Expand Down

0 comments on commit 9161c89

Please sign in to comment.