Don't assume the charset is specified - fallback to us-ascii if it isn't.
authortassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 17 Oct 2003 21:14:04 +0000 (21:14 +0000)
committertassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 17 Oct 2003 21:14:04 +0000 (21:14 +0000)
Doesn't anyone test variables before using them anymore?

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5945 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index bb877878e7e6be389f54b98838ae99b779b7dbef..752aa3cfb04e424172deecbd554d39bfdd724b8b 100644 (file)
@@ -620,7 +620,12 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
                 }
             }
            
-           $actual = $body_part_entity->header->parameters['charset'];
+           if (isset($body_part_entity->header->parameters['charset'])) {
+            $actual = $body_part_entity->header->parameters['charset'];
+        } else {
+            $actual = 'us-ascii';
+        }
+
            if ( $actual && is_conversion_safe($actual) && $actual != $default_charset){
                $bodypart = charset_decode($actual,$bodypart);
            }