View Issue Details

IDProjectCategoryView StatusLast Update
0017645phpList 3 applicationBounce Managementpublic21-06-18 14:05
Reporterbst2002 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.0.10 
Summary0017645: Bounce Page bounce.php
DescriptionSome Bounce-Emails have a incorrect/mixed charset and so at the Bounce-Page bounce.php in Section Body you see nothing because htmlspecialchars() Fails!.
I don't know if it makes sense to encode everytime and so no need for the "if".


Line abount No.: 204
//FIX body bad coded charset, bad_utf8 etc
/**
*
*/
function encodeToUTF8($string) {
  return mb_convert_encoding($string, "UTF-8", mb_detect_encoding($string, "UTF-8, ISO-8859-1, ISO-8859-15", true));
}
$_bounceBody=htmlspecialchars($bounceBody);
if (empty($_bounceBody)) {
  $bounceBody=encodeToUTF8($bounceBody);
}

$bouncedetail = sprintf ('
  <div class="fleft"><div class="label">'.$GLOBALS['I18N']->get('ID').'</div><div class="content">%d</div></div>
  <div class="fleft"><div class="label">'.$GLOBALS['I18N']->get('Date').'</div><div class="content">%s</div></div>
  <div class="fleft"><div class="label">'.$GLOBALS['I18N']->get('Status').'</div><div class="content">%s</div></div>
  <div class="clear"></div>
......
Steps To Reproduce$bouncedetail = sprintf ('
  <div class="fleft"><div class="label">'.$GLOBALS['I18N']->get('ID').'</div><div class="content">%d</div></div>
  <div class="fleft"><div class="label">'.$GLOBALS['I18N']->get('Date').'</div><div class="content">%s</div></div>
  <div class="fleft"><div class="label">'.$GLOBALS['I18N']->get('Status').'</div><div class="content">%s</div></div>
  <div class="clear"></div>

  <div class="label">'.$GLOBALS['I18N']->get('Comment').'</div><div class="content">%s</div>

  <div class="label">'.$GLOBALS['I18N']->get('Header').'</div><div class="content">%s</div>

  <div class="label">'.$GLOBALS['I18N']->get('Body').'</div><div class="content">%s</div>',$id,
  $bounce["date"],$bounce["status"],$bounce["comment"],
  nl2br(htmlspecialchars($bounce["header"])),nl2br(htmlspecialchars($bounceBody)));
Tagsneedinfo

Activities

michiel

16-04-15 12:50

administrator   ~0056015

can you upload some source bounces where this happened? Just upload them to this issue as TXT files.

Also, can you describe your fix?

1. before X
2. after Y

etc

bst2002

16-04-15 13:37

reporter   ~0056018

Hallo, fix is described in "Description" Function etc. before "$bouncedetail = sprintf"

bst2002

16-04-15 13:42

reporter  

michiel

16-04-15 13:48

administrator   ~0056019

You're hard coding the ISO-8859-1, ISO-8859-15

that is very specific for your situation.

Can you also upload the original bounce source, if you still have it.