aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-11-16 20:16:36 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-11-16 20:16:36 +0000
commit8b0e11a4c90e63de733d4043b573e846af9c787e (patch)
tree9a845f5bdc14189ce77a654ab0da1dae658ad9fd /phpBB
parent311c0d8e4f22d39d8d726186874f3d9f656d5c42 (diff)
downloadforums-8b0e11a4c90e63de733d4043b573e846af9c787e.tar
forums-8b0e11a4c90e63de733d4043b573e846af9c787e.tar.gz
forums-8b0e11a4c90e63de733d4043b573e846af9c787e.tar.bz2
forums-8b0e11a4c90e63de733d4043b573e846af9c787e.tar.xz
forums-8b0e11a4c90e63de733d4043b573e846af9c787e.zip
#5362
- small opti/bugfix in normalizer git-svn-id: file:///svn/phpbb/trunk@6593 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/utf/utf_normalizer.php11
-rw-r--r--phpBB/includes/utf/utf_tools.php15
2 files changed, 14 insertions, 12 deletions
diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php
index 62923ccbe4..5c4ddda610 100644
--- a/phpBB/includes/utf/utf_normalizer.php
+++ b/phpBB/includes/utf/utf_normalizer.php
@@ -322,16 +322,11 @@ class utf_normalizer
*/
if ($utf_char[0] >= "\xF8")
{
- if ($utf_char[0] < "\xF8")
- {
- $trailing_bytes = 3;
- }
- else if ($utf_char[0] < "\xFC")
+ if ($utf_char[0] < "\xFC")
{
$trailing_bytes = 4;
}
-
- if ($utf_char[0] > "\xFD")
+ else if ($utf_char[0] > "\xFD")
{
$trailing_bytes = 0;
}
@@ -931,7 +926,7 @@ class utf_normalizer
*/
function decompose($str, $pos, $len, &$decomp_map)
{
- global $utf_combining_class, $utf_canonical_decomp, $phpbb_root_path;
+ global $utf_combining_class, $phpbb_root_path;
// Load some commonly-used tables
if (!isset($utf_combining_class))
diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php
index b181023f57..0a4763b080 100644
--- a/phpBB/includes/utf/utf_tools.php
+++ b/phpBB/includes/utf/utf_tools.php
@@ -126,7 +126,14 @@ if (extension_loaded('mbstring'))
return false;
}
- return mb_strrpos($str, $search);
+ if (is_null($offset))
+ {
+ return mb_strrpos($str, $search);
+ }
+ else
+ {
+ return mb_strrpos($str, $search, $offset);
+ }
}
}
else
@@ -138,7 +145,7 @@ if (extension_loaded('mbstring'))
function utf8_strrpos($str, $needle, $offset = null)
{
// offset for mb_strrpos was added in 5.2.0
- if ($offset === false)
+ if (is_null($offset))
{
// Emulate behaviour of strrpos rather than raising warning
if (empty($str))
@@ -174,7 +181,7 @@ if (extension_loaded('mbstring'))
*/
function utf8_strpos($str, $needle, $offset = null)
{
- if ($offset === false)
+ if (is_null($offset))
{
return mb_strpos($str, $needle);
}
@@ -208,7 +215,7 @@ if (extension_loaded('mbstring'))
*/
function utf8_substr($str, $offset, $length = null)
{
- if ($length === false)
+ if (is_null($length))
{
return mb_substr($str, $offset);
}