]> wagnertech.de Git - timetracker.git/blobdiff - invoice_send.php
Added MIME decoder for SENDER.
[timetracker.git] / invoice_send.php
index b9e2a29321ed17d25980d79c8d0a9bd00bf3ad62..6d85d5445db2c78518de89b25e2c18212f7e30be 100644 (file)
@@ -94,6 +94,16 @@ if ($request->isPost()) {
   }
 } // isPost
 
+$smarty->assign('sender', SENDER);
+if (function_exists('imap_mime_header_decode')) {
+  // Decode sender in case it is encoded. PHP IMAP extension must be installed for us to get here.
+  $elements = imap_mime_header_decode(SENDER);
+  if (count($elements) > 1) {
+      // Reassign sender.
+      $smarty->assign('sender', $elements[count($elements) - 2]->text);
+  }
+}
+
 $smarty->assign('title', $i18n->getKey('title.send_invoice'));
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"');