From 1671b9c65c483508c717cf356691de41a64b4e7b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 9 May 2012 10:23:20 +0200 Subject: [PATCH] BUGFIX Checking for mbstring PHP extension support in installer, as it has been a documented installation requirement for a while. Removing method_exists() checks from mbstring usage in core for the same reasons --- core/Core.php | 8 +++----- dev/install/install.php5 | 5 ++++- model/URLSegmentFilter.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/Core.php b/core/Core.php index d2e25d102..ac090a33b 100644 --- a/core/Core.php +++ b/core/Core.php @@ -203,11 +203,9 @@ increase_xdebug_nesting_level_to(200); /** * Set default encoding */ -if(function_exists('mb_http_output')) { - mb_http_output('UTF-8'); - mb_internal_encoding('UTF-8'); - mb_regex_encoding('UTF-8'); -} +mb_http_output('UTF-8'); +mb_internal_encoding('UTF-8'); +mb_regex_encoding('UTF-8'); /////////////////////////////////////////////////////////////////////////////// // INCLUDES diff --git a/dev/install/install.php5 b/dev/install/install.php5 index e51405f80..22d456eb3 100644 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -431,8 +431,11 @@ class InstallRequirements { // Check for iconv support $this->requireFunction('iconv', array('PHP Configuration', 'iconv support', 'iconv support not included in PHP.')); + // Check for mbstring support + $this->requireFunction('iconv', array('PHP Configuration', 'iconv support', 'iconv support not included in PHP.')); + // Check for hash support - $this->requireFunction('hash', array('PHP Configuration', 'hash support', 'hash support not included in PHP.')); + $this->requireFunction('mb_internal_encoding', array('PHP Configuration', 'mbstring support', 'mbstring support not included in PHP.')); // Check for Reflection support $this->requireClass('ReflectionClass', array('PHP Configuration', 'Reflection support', 'Reflection support not included in PHP.')); diff --git a/model/URLSegmentFilter.php b/model/URLSegmentFilter.php index 5d64ddd45..47c2a6f81 100644 --- a/model/URLSegmentFilter.php +++ b/model/URLSegmentFilter.php @@ -62,7 +62,7 @@ class URLSegmentFilter extends Object { if($transliterator) $name = $transliterator->toASCII($name); } - $name = (function_exists('mb_strtolower')) ? mb_strtolower($name) : strtolower($name); + $name = mb_strtolower($name); $replacements = $this->getReplacements(); if($this->getAllowMultibyte()) { // unset automated removal of non-ASCII characters, and don't try to transliterate