1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 12:30:42 +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:
Igor Wiedler
2010-06-25 19:09:17 +02:00
parent eda9fbbb63
commit 6b4d0a2542
5 changed files with 21 additions and 11 deletions

View File

@@ -1490,7 +1490,7 @@ function validate_username($username, $allowed_username = false)
$mbstring = $pcre = false;
// generic UTF-8 character types supported?
if (@preg_match('/\p{L}/u', 'a') !== false)
if (pcre_utf8_support())
{
$pcre = true;
}
@@ -1626,7 +1626,7 @@ function validate_password($password)
$pcre = $mbstring = false;
// generic UTF-8 character types supported?
if (@preg_match('/\p{L}/u', 'a') !== false)
if (pcre_utf8_support())
{
$upp = '\p{Lu}';
$low = '\p{Ll}';