From: kink Date: Fri, 2 Mar 2007 23:15:52 +0000 (+0000) Subject: Prevent including index.php for charset decoding/encoding (#1671874) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ee872922b316471c736f1e0a3c419edfc7274a2a;p=squirrelmail.git Prevent including index.php for charset decoding/encoding (#1671874) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12294 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/include/languages.php b/include/languages.php index e7976429..c6b93a5a 100644 --- a/include/languages.php +++ b/include/languages.php @@ -191,7 +191,7 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals $decode=fixcharset($charset); $decodefile=SM_PATH . 'functions/decode/' . $decode . '.php'; - if (file_exists($decodefile)) { + if ($decode != 'index' && file_exists($decodefile)) { include_once($decodefile); // send $save_html argument to decoding function. needed for iso-2022-xx decoding. $ret = call_user_func('charset_decode_'.$decode, $string, $save_html); @@ -214,7 +214,7 @@ function charset_encode($string,$charset,$htmlencode=true) { $encode=fixcharset($charset); $encodefile=SM_PATH . 'functions/encode/' . $encode . '.php'; - if (file_exists($encodefile)) { + if ($encode != 'index' && file_exists($encodefile)) { include_once($encodefile); $ret = call_user_func('charset_encode_'.$encode, $string); } elseif(file_exists(SM_PATH . 'functions/encode/us_ascii.php')) {