1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-10 00:15:00 +02:00

Merge remote-tracking branch 'bantu/ticket/10329' into develop

* bantu/ticket/10329:
  [ticket/10329] Add phpbb_ prefix to new pcre_utf8_support() function.
This commit is contained in:
Igor Wiedler 2011-08-21 15:21:25 +02:00
commit 4bc09cd34d
4 changed files with 6 additions and 6 deletions

View File

@ -317,7 +317,7 @@ class acp_bbcodes
$bbcode_tpl = trim($bbcode_tpl); $bbcode_tpl = trim($bbcode_tpl);
$utf8 = strpos($bbcode_match, 'INTTEXT') !== false; $utf8 = strpos($bbcode_match, 'INTTEXT') !== false;
$utf8_pcre_properties = pcre_utf8_support(); $utf8_pcre_properties = phpbb_pcre_utf8_support();
$fp_match = preg_quote($bbcode_match, '!'); $fp_match = preg_quote($bbcode_match, '!');
$fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match); $fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match);

View File

@ -3285,7 +3285,7 @@ function get_censor_preg_expression($word, $use_unicode = true)
// Unescape the asterisk to simplify further conversions // Unescape the asterisk to simplify further conversions
$word = str_replace('\*', '*', preg_quote($word, '#')); $word = str_replace('\*', '*', preg_quote($word, '#'));
if ($use_unicode && pcre_utf8_support()) if ($use_unicode && phpbb_pcre_utf8_support())
{ {
// Replace asterisk(s) inside the pattern, at the start and at the end of it with regexes // Replace asterisk(s) inside the pattern, at the start and at the end of it with regexes
$word = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*+(?=[\p{Nd}\p{L}_])#iu', '#^\*+#', '#\*+$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $word); $word = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*+(?=[\p{Nd}\p{L}_])#iu', '#^\*+#', '#\*+$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $word);
@ -4742,7 +4742,7 @@ function phpbb_user_session_handler()
* *
* @return bool Returns true if PCRE (the regular expressions library) supports UTF-8 encoding * @return bool Returns true if PCRE (the regular expressions library) supports UTF-8 encoding
*/ */
function pcre_utf8_support() function phpbb_pcre_utf8_support()
{ {
static $utf8_pcre_properties = null; static $utf8_pcre_properties = null;
if (is_null($utf8_pcre_properties)) if (is_null($utf8_pcre_properties))

View File

@ -1477,7 +1477,7 @@ function validate_username($username, $allowed_username = false)
$mbstring = $pcre = false; $mbstring = $pcre = false;
// generic UTF-8 character types supported? // generic UTF-8 character types supported?
if (pcre_utf8_support()) if (phpbb_pcre_utf8_support())
{ {
$pcre = true; $pcre = true;
} }
@ -1614,7 +1614,7 @@ function validate_password($password)
$pcre = $mbstring = false; $pcre = $mbstring = false;
// generic UTF-8 character types supported? // generic UTF-8 character types supported?
if (pcre_utf8_support()) if (phpbb_pcre_utf8_support())
{ {
$upp = '\p{Lu}'; $upp = '\p{Lu}';
$low = '\p{Ll}'; $low = '\p{Ll}';

View File

@ -43,7 +43,7 @@ class fulltext_mysql extends search_backend
$this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']); $this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']);
// PHP may not be linked with the bundled PCRE lib and instead with an older version // PHP may not be linked with the bundled PCRE lib and instead with an older version
if (pcre_utf8_support()) if (phpbb_pcre_utf8_support())
{ {
$this->pcre_properties = true; $this->pcre_properties = true;
} }