aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/utf/utf_tools.php
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2011-04-19 12:53:36 +0200
committerMichael Scherer <misc@zarb.org>2011-04-19 12:53:36 +0200
commit1bac695a72e263a4bd71d1d8079e06bb227c1077 (patch)
tree7246e2206346fb635a9bb69fac942ead2d9d80b7 /phpBB/includes/utf/utf_tools.php
parentb85c3b967a7f6fa061439061076695613622960c (diff)
downloadforums-1bac695a72e263a4bd71d1d8079e06bb227c1077.tar
forums-1bac695a72e263a4bd71d1d8079e06bb227c1077.tar.gz
forums-1bac695a72e263a4bd71d1d8079e06bb227c1077.tar.bz2
forums-1bac695a72e263a4bd71d1d8079e06bb227c1077.tar.xz
forums-1bac695a72e263a4bd71d1d8079e06bb227c1077.zip
revert previous commit, as phpbb-seo is incompatible with phpbb license
the commit is still in git, and can be reserected with a branch, but having it on HEAD make forum deployment more difficult
Diffstat (limited to 'phpBB/includes/utf/utf_tools.php')
-rw-r--r--phpBB/includes/utf/utf_tools.php51
1 files changed, 14 insertions, 37 deletions
diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php
index 31ad5027fd..6f3ac93305 100644
--- a/phpBB/includes/utf/utf_tools.php
+++ b/phpBB/includes/utf/utf_tools.php
@@ -105,10 +105,6 @@ if (!extension_loaded('xml'))
if (extension_loaded('mbstring'))
{
mb_internal_encoding('UTF-8');
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // ini_set is only used to try to make things better for mods using mbstring directly
- // I know they're not supposed to, but you know they still could and the fix is costless
- @ini_set("mbstring.internal_encoding", 'UTF-8');
/**
* UTF-8 aware alternative to strrpos
@@ -133,15 +129,11 @@ if (extension_loaded('mbstring'))
if (is_null($offset))
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strrpos($str, $needle, 0, 'UTF-8');
+ return mb_strrpos($str, $needle);
}
else
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strrpos($str, $needle, $offset, 'UTF-8');
+ return mb_strrpos($str, $needle, $offset);
}
}
}
@@ -161,9 +153,8 @@ if (extension_loaded('mbstring'))
{
return false;
}
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strrpos($str, $needle, 'UTF-8');
+
+ return mb_strrpos($str, $needle);
}
else
{
@@ -172,12 +163,10 @@ if (extension_loaded('mbstring'))
trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_ERROR);
return false;
}
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- $str = mb_substr($str, $offset, mb_strlen($str, 'UTF-8'), 'UTF-8');
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- if (false !== ($pos = mb_strrpos($str, $needle, 'UTF-8')))
+
+ $str = mb_substr($str, $offset);
+
+ if (false !== ($pos = mb_strrpos($str, $needle)))
{
return $pos + $offset;
}
@@ -195,15 +184,11 @@ if (extension_loaded('mbstring'))
{
if (is_null($offset))
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strpos($str, $needle, 0, 'UTF-8');
+ return mb_strpos($str, $needle);
}
else
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strpos($str, $needle, $offset, 'UTF-8');
+ return mb_strpos($str, $needle, $offset);
}
}
@@ -213,9 +198,7 @@ if (extension_loaded('mbstring'))
*/
function utf8_strtolower($str)
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strtolower($str, 'UTF-8');
+ return mb_strtolower($str);
}
/**
@@ -224,9 +207,7 @@ if (extension_loaded('mbstring'))
*/
function utf8_strtoupper($str)
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_strtoupper($str, 'UTF-8');
+ return mb_strtoupper($str);
}
/**
@@ -237,15 +218,11 @@ if (extension_loaded('mbstring'))
{
if (is_null($length))
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_substr($str, $offset, mb_strlen($str, 'UTF-8'), 'UTF-8');
+ return mb_substr($str, $offset);
}
else
{
- // Fix for http://www.phpbb.com/bugs/phpbb3/52315
- // Explicit encoding
- return mb_substr($str, $offset, $length, 'UTF-8');
+ return mb_substr($str, $offset, $length);
}
}