From 755663a00a1f4bf05ae029d53ade8509f8df9fea Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 4 Dec 2011 13:21:15 +0100 Subject: [PATCH] BUGFIX Set default mbstring encoding in Core.php instead of main.php and cli-script.php so phpunit binary test runs behave consistently (same as running through TestRunner+cli-script.php). Fixes URLSegmentFilterTest --- cli-script.php | 6 ------ core/Core.php | 9 +++++++++ main.php | 6 ------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cli-script.php b/cli-script.php index 7969a880c..a65baaa90 100755 --- a/cli-script.php +++ b/cli-script.php @@ -61,12 +61,6 @@ if(isset($_SERVER['argv'][1])) { */ require_once("core/Core.php"); -if(function_exists('mb_http_output')) { - mb_http_output('UTF-8'); - mb_internal_encoding('UTF-8'); - mb_regex_encoding('UTF-8'); -} - global $databaseConfig; // We don't have a session in cli-script, but this prevents errors diff --git a/core/Core.php b/core/Core.php index bac9704af..c60295dd8 100644 --- a/core/Core.php +++ b/core/Core.php @@ -195,6 +195,15 @@ define('PR_LOW',10); */ increase_memory_limit_to('64M'); +/** + * Set default encoding + */ +if(function_exists('mb_http_output')) { + mb_http_output('UTF-8'); + mb_internal_encoding('UTF-8'); + mb_regex_encoding('UTF-8'); +} + /////////////////////////////////////////////////////////////////////////////// // INCLUDES diff --git a/main.php b/main.php index b99426088..651e8416a 100644 --- a/main.php +++ b/main.php @@ -60,12 +60,6 @@ if(version_compare(phpversion(), 5, '<')) { */ require_once("core/Core.php"); -if (function_exists('mb_http_output')) { - mb_http_output('UTF-8'); - mb_internal_encoding('UTF-8'); - mb_regex_encoding('UTF-8'); -} - Session::start(); // IIS will sometimes generate this.