From 9280dd9deb9ca36a30fa6395671a47f3c844f041 Mon Sep 17 00:00:00 2001 From: tokul Date: Wed, 20 Jul 2005 10:07:30 +0000 Subject: [PATCH] add extra checks in case some yahoo user decides to remove all us-ascii libraries. (#1239782) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9796 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 4 +++- functions/i18n.php | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56336139..4cac9969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -402,7 +402,9 @@ Version 1.5.1 -- CVS - Fixes for increased error checking in PHP 5.1 array_shift() (#1237160). - Added extra checks in delivery class for In-Reply-To header. Fixes E_NOTICE level warnings in php 5.0.4 and later (#1206474). [php5] - + - Added extra checks in SquirrelMail charset_encode() function in case + somebody removed html to us-ascii conversion library (#1239782). + Version 1.5.0 - 2 February 2004 ------------------------------- - Added new preference that determines cursor focus when replying diff --git a/functions/i18n.php b/functions/i18n.php index 15db37f9..779734de 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -197,9 +197,16 @@ function charset_encode($string,$charset,$htmlencode=true) { if (file_exists($encodefile)) { include_once($encodefile); $ret = call_user_func('charset_encode_'.$encode, $string); - } else { + } elseif(file_exists(SM_PATH . 'functions/encode/us_ascii.php')) { + // function replaces all 8bit html entities with question marks. + // it is used when other encoding functions are unavailable include_once(SM_PATH . 'functions/encode/us_ascii.php'); $ret = charset_encode_us_ascii($string); + } else { + /** + * fix for yahoo users that remove all us-ascii related things + */ + $ret = $string; } /** -- 2.25.1