mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 00:07:44 +02:00
[ticket/9574] Add pcre_utf8_support() function
Refactor the check for PCRE UTF-8 support into a new pcre_utf8_support() function. PHPBB3-9574
This commit is contained in:
@@ -4507,3 +4507,19 @@ function phpbb_user_session_handler()
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if PCRE has UTF-8 support
|
||||
* PHP may not be linked with the bundled PCRE lib and instead with an older version
|
||||
*
|
||||
* @return bool Returns true if PCRE (the regular expressions library) supports UTF-8 encoding
|
||||
*/
|
||||
function pcre_utf8_support()
|
||||
{
|
||||
static $utf8_pcre_properties = null;
|
||||
if (is_null($utf8_pcre_properties))
|
||||
{
|
||||
$utf8_pcre_properties = (@preg_match('/\p{L}/u', 'a') !== false);
|
||||
}
|
||||
return $utf8_pcre_properties;
|
||||
}
|
||||
|
Reference in New Issue
Block a user