mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix incorrect return type of utf8_trim() if input string contains invalid UTF-8 sequence
This commit is contained in:
parent
3a322cdfce
commit
0c815fc27b
1 changed files with 1 additions and 1 deletions
|
|
@ -692,7 +692,7 @@ function utf8_normalize_spaces($str, bool $multiline = false): string
|
|||
*/
|
||||
function utf8_trim($str): string
|
||||
{
|
||||
return preg_replace('/^[\s\pZ\pC]+|[\s\pZ\pC]+$/u', '', (string)$str);
|
||||
return preg_replace('/^[\s\pZ\pC]+|[\s\pZ\pC]+$/u', '', (string)$str) ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue