Skip to content

Commit

Permalink
! that may fail or even partially decode, check for that
Browse files Browse the repository at this point in the history
  • Loading branch information
Spuds committed Aug 5, 2022
1 parent 30f0f8c commit c918a1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sources/subs/EmailParse.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,13 @@ private function _decode_header($val, $strict = false)
// If iconv mime is available just use it and be done
if (function_exists('iconv_mime_decode'))
{
return iconv_mime_decode($val, $strict ? 1 : 2, 'UTF-8');
$decoded = iconv_mime_decode($val, $strict ? 1 : 2, 'UTF-8');

// Bad decode, or partial decode
if ($decoded !== false && strpos($decoded, '=?iso') === false)
{
return $decoded;
}
}

// The RFC 2047-3 defines an encoded-word as a sequence of characters that
Expand Down

0 comments on commit c918a1c

Please sign in to comment.