Description of problem: Version-Release number of selected component (if applicable): squirrelmail-1.4.8-4.fc6 How reproducible: 100% Steps to Reproduce: 1. cat /var/log/httpd/error_log 2. 3. Actual results: Gives lots of errors such as [Tue Feb 20 16:57:15 2007] [error] [client 82.33.111.168] PHP Notice: Undefined variable: charset in /usr/share/squirrelmail/functions/mime.php on line 317, referer: http://mail.ji-tu.com/webmail/src/right_main.php Expected results: Shouldn't give any errors Additional info:
Error comes from squirrelmail-1.4.8-IE-Japanese-download-ugly-hack.patch --- + if (!$charset_converted) { + if ($charset == 'iso-2022-jp' || $charset == 'shift_jis' || $charset == 'euc-jp' || + ($squirrelmail_language == 'ja_JP' && + ($charset == 'utf-8' || $charset == '' || $charset == 'us-ascii'))) { + $body = $languages['ja_JP']['XTRA_CODE']('decode', $body); + $charset_converted = true; + } + } --- $charset_converted variable is not initialized. You need '$charset_converted = false;' before 'if (!$charset_converted) {' --- + $charset_converted = false; + if (charset == 'iso-2022-jp' || $charset == 'shift_jis' || $charset == 'euc-$jp' || + ($squirrelmail_language == 'ja_JP' && + ($charset == 'utf-8' || $charset == '' || $charset == 'us-ascii'))) { + $body = $languages['ja_JP']['XTRA_CODE']('decode', $body); + $charset_converted = true; + } --- $charset variable is not set and all $charset = 'some-charset' tests are questionable. ($charset == 'iso-2022-jp' - always false || $charset == 'shift_jis' - always false || $charset == 'euc-jp' - always false || ($squirrelmail_language == 'ja_JP' && - true in Japanese translation ($charset == 'utf-8' || $charset == '' || $charset == 'us-ascii') - always true )) Is there some Fedora bug report proving that correctly formated mime messages need more than $charset_converted and Japanese translation test? If patch wanted to test $default_charset var, then it still does not explain why Japanese extra code is applied to US English translation. --- + $charset_converted = false; + if ($squirrelmail_language == 'ja_JP') { + $body = $languages['ja_JP']['XTRA_CODE']('decode', $body); + $charset_converted = true; + } --- Please note that SquirrelMail guidelines require coding in PHP error_reporting= E_ALL, display_errors=on and register_globals=off environment. Fedora patches should be tested in such PHP setups. First two settings allow to catch programming mistakes, third setting eliminates use of unchecked globals. If you use SquirrelMail 1.4.7 or later, register_globals = on setups might behave differently only when SquirrelMail core functions are not loaded or they are loaded in incorrect order.
*** This bug has been marked as a duplicate of 235560 ***
This issue was fixed in RAWHIDE, but patch cuasing it looks somehow wierd. It will need some more investigation.
Fianlly I removed parts modifying formatBody function from the ugly-hack patch. Error messages no longer appear in log so I regard this issue as fixed. Feel free to reopen this bug if errors reappear. Fixed version is squirrelmail-1.4.9a-2.fc7 in RAWHIDE.
*** Bug 204211 has been marked as a duplicate of this bug. ***