Skip to content

Commit

Permalink
Merge branch 'master' into combined-regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Jul 28, 2023
2 parents bbf5cb8 + 574a802 commit c1c486c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- Enh #102: Add `CombinedRegexp` class (@xepozz)

## 2.1.2 July 27, 2023

- Bug #105: Fix incorrect split UTF-8 strings in `StringHelper::split()` method (@vjik)

## 2.1.1 April 28, 2023

- Enh #85: Improve `StringHelper::parsePath()` method annotation (@vjik)
Expand Down
2 changes: 1 addition & 1 deletion src/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public static function base64UrlDecode(string $input): string
public static function split(string $string, string $separator = '\R'): array
{
$string = preg_replace('(^\s*|\s*$)', '', $string);
return preg_split('~\s*' . $separator . '\s*~', $string, -1, PREG_SPLIT_NO_EMPTY);
return preg_split('~\s*' . $separator . '\s*~u', $string, -1, PREG_SPLIT_NO_EMPTY);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions tests/StringHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ public function dataSplit(): array
"\0\nA\nB",
["\0", 'A', 'B'],
],
[
"технический\nдолг",
['технический', 'долг'],
],
];
}

Expand Down

0 comments on commit c1c486c

Please sign in to comment.