mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
parent
f62917578e
commit
360bf5db46
1 changed files with 4 additions and 5 deletions
|
@ -239,13 +239,12 @@ function htmlCHR($txt, bool $double_encode = false, int $quote_style = ENT_QUOTE
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|null $str
|
* @param string $str
|
||||||
* @return string|null
|
* @return string
|
||||||
*/
|
*/
|
||||||
function str_compact(string|null $str): ?string
|
function str_compact($str)
|
||||||
{
|
{
|
||||||
$str ??= '';
|
return preg_replace('#\s+#u', ' ', trim($str ?? ''));
|
||||||
return preg_replace('#\s+#u', ' ', trim($str));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue