Add check for mb_trim, as it's built-in on PHP 8.4

This commit is contained in:
Timothy Warren 2025-03-21 13:16:51 -04:00
parent 433448fd8d
commit e00b56aac4

View File

@ -19,6 +19,9 @@ use Query\{ConnectionManager, QueryBuilderInterface};
/** /**
* Global functions that don't really fit anywhere else * Global functions that don't really fit anywhere else
*/ */
if ( ! function_exists('mb_trim'))
{
/** /**
* Multibyte-safe trim function * Multibyte-safe trim function
*/ */
@ -26,6 +29,7 @@ function mb_trim(string $string): string
{ {
return preg_replace('/(^\s+)|(\s+$)/u', '', $string); return preg_replace('/(^\s+)|(\s+$)/u', '', $string);
} }
}
/** /**
* Filter out db rows into one array * Filter out db rows into one array