Browse Source

Don't assume the charset is specified - fallback to us-ascii if it isn't.
Doesn't anyone test variables before using them anymore?

tassium 22 years ago
parent
commit
5e8c6d7b70
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/compose.php

+ 6 - 1
src/compose.php

@@ -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);
 	    }