Revert "Update common.php"

This reverts commit 3911e72dba.
This commit is contained in:
Roman Kelesidis 2024-09-05 18:03:01 +07:00
commit 360bf5db46

View file

@ -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));
} }
/** /**