Bug 229454 - Errors in /var/log/httpd/error_log
Summary: Errors in /var/log/httpd/error_log
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: squirrelmail
Version: rawhide
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Martin Bacovsky
QA Contact:
URL:
Whiteboard:
: 204211 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-21 09:01 UTC by Nigel Horne
Modified: 2008-05-07 09:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-24 12:22:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Nigel Horne 2007-02-21 09:01:59 UTC
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:

Comment 1 Tomas 2007-02-25 10:13:59 UTC
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.


Comment 2 Nicolas Mailhot 2007-04-12 05:58:20 UTC

*** This bug has been marked as a duplicate of 235560 ***

Comment 3 Martin Bacovsky 2007-04-17 17:22:29 UTC
This issue was fixed in RAWHIDE, but patch cuasing it looks somehow wierd. It
will need some more investigation.

Comment 4 Martin Bacovsky 2007-04-24 12:19:00 UTC
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.

Comment 5 Zing 2008-04-04 04:35:50 UTC
*** Bug 204211 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.