From: tassium Date: Fri, 17 Oct 2003 21:14:04 +0000 (+0000) Subject: Don't assume the charset is specified - fallback to us-ascii if it isn't. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=beca818e046f6e9b870c23ed9d203ca563568e18;p=squirrelmail.git Don't assume the charset is specified - fallback to us-ascii if it isn't. 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 --- diff --git a/src/compose.php b/src/compose.php index bb877878..752aa3cf 100644 --- a/src/compose.php +++ b/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); }