From eda9fbbb6363cad0f2035b7a1f9fafe27f23832b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 25 Jun 2010 13:31:31 +0200 Subject: [ticket/9574] Remove conditional PHP<5.2 code There is a large amount of conditional code for PHP < 5.2 that can be removed with phpBB 3.1. PHPBB3-9574 --- phpBB/includes/functions_user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_user.php') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8d6ed07aa0..9ab9d6d568 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1490,7 +1490,7 @@ function validate_username($username, $allowed_username = false) $mbstring = $pcre = false; // generic UTF-8 character types supported? - if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false) + if (@preg_match('/\p{L}/u', 'a') !== false) { $pcre = true; } @@ -1626,7 +1626,7 @@ function validate_password($password) $pcre = $mbstring = false; // generic UTF-8 character types supported? - if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false) + if (@preg_match('/\p{L}/u', 'a') !== false) { $upp = '\p{Lu}'; $low = '\p{Ll}'; -- cgit v1.2.1 From 6b4d0a254218e8d40151ca1bdff8c439f89502e9 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 25 Jun 2010 19:09:17 +0200 Subject: [ticket/9574] Add pcre_utf8_support() function Refactor the check for PCRE UTF-8 support into a new pcre_utf8_support() function. PHPBB3-9574 --- phpBB/includes/functions_user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_user.php') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 9ab9d6d568..b99393d24a 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -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}'; -- cgit v1.2.1