mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -07:00
Update common.php
This commit is contained in:
parent
2edc6684fe
commit
3911e72dba
1 changed files with 5 additions and 4 deletions
|
@ -239,12 +239,13 @@ function htmlCHR($txt, bool $double_encode = false, int $quote_style = ENT_QUOTE
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $str
|
* @param string|null $str
|
||||||
* @return string
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
function str_compact($str)
|
function str_compact(string|null $str): ?string
|
||||||
{
|
{
|
||||||
return preg_replace('#\s+#u', ' ', trim($str ?? ''));
|
$str ??= '';
|
||||||
|
return preg_replace('#\s+#u', ' ', trim($str));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue