mailheader-decoding: check if there is a possible nested encoding; make sure that the inputstring and the decoded result are different before recursively calling decodeMailHeader on the decoded result (to avoid loops)

This commit is contained in:
Klaus Leithoff 2012-11-07 11:46:14 +00:00
parent b9192c0f4c
commit 3420b15ff4

View File

@ -875,7 +875,8 @@ class translation
if ($element->charset != 'x-unknown')
{
if( strtoupper($element->charset) != 'UTF-8') $element->text = preg_replace($sar,$rar,$element->text);
if(preg_match('/\?=.+=\?/', $element->text))
// check if there is a possible nested encoding; make sure that the inputstring and the decoded result are different to avoid loops
if(preg_match('/\?=.+=\?/', $element->text) && $element->text != $_string)
{
$element->text = self::decodeMailHeader($element->text, $element->charset);
$element->charset = $displayCharset;