Skip to content

Commit

Permalink
Merge branch '4.4' into 5.4
Browse files Browse the repository at this point in the history
* 4.4:
  [DowCrawler] Fix locale-sensitivity of whitespace normalization
  suggest to install the Twig bundle when the required component is already installed
  Update PULL_REQUEST_TEMPLATE.md
  • Loading branch information
nicolas-grekas committed Aug 3, 2022
1 parent 5eb661e commit 0145442
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AbstractString.php
Expand Up @@ -245,7 +245,7 @@ abstract public function chunk(int $length = 1): array;
public function collapseWhitespace(): self
{
$str = clone $this;
$str->string = trim(preg_replace('/(?:\s{2,}+|[^\S ])/', ' ', $str->string));
$str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C");

return $str;
}
Expand Down

0 comments on commit 0145442

Please sign in to comment.