From 6c16a0d1da5fa41ac6710dc43720e46cafb82117 Mon Sep 17 00:00:00 2001 From: Alexey Chumakov Date: Sat, 30 Sep 2006 22:23:57 +0000 Subject: [PATCH] Annoying bug 'xxx charset not supported' which made Croatian, Hungarian, Polish, Romanian, Korean, Latvian, Lithuanian, Slovene and Czech translations unusable is now fixed. Just one char. git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4203 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- core/string_api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/string_api.php b/core/string_api.php index bd4a20c395..8ad8d7b303 100644 --- a/core/string_api.php +++ b/core/string_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: string_api.php,v 1.82 2006-07-05 03:14:07 thraxisp Exp $ + # $Id: string_api.php,v 1.83 2006-09-30 22:23:57 achumakov Exp $ # -------------------------------------------------------- $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR; @@ -695,7 +695,10 @@ function string_html_entities( $p_string ) { # the current charset, if the current PHP version supports it. function string_html_specialchars( $p_string ) { if ( php_version_at_least( '4.1.0' ) ) { - return htmlspecialchars( $p_string, ENT_COMPAT, lang_get( 'charset' ) ); + # achumakov: @ added to avoid warning output in unsupported codepages + # e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1. + # This is VERY important for Eastern European, Baltic and Korean languages + return @htmlspecialchars( $p_string, ENT_COMPAT, lang_get( 'charset' ) ); } else { return htmlspecialchars( $p_string ); }