v5.0-git
--------
+[mms] Link URLs/e-mails in subjects in message views (Request #7487).
[mms] Implement spellcheck on send in DIMP.
[mms] Sanity check - don't do message operations reliant on UID list if
UIDVALIDITY of mailbox has changed.
return implode("\n", $out) . "\n</table>\n";
}
+ /**
+ * Get the display subject (filtered, formatted, and linked).
+ *
+ * @param string $subject The subject text.
+ *
+ * @return string The display subject string.
+ */
+ public function getDisplaySubject($subject)
+ {
+ require_once 'Horde/Text.php';
+ require_once 'Horde/Text/Filter.php';
+
+ $subject = IMP::filterText($subject);
+ if (!($disp_subject = Text::htmlSpaces($subject))) {
+ $disp_subject = $subject;
+ }
+
+ return Text_Filter::filter($disp_subject, 'text2html', array('parselevel' => TEXT_HTML_MICRO, 'class' => null, 'callback' => null));
+ }
+
}
}
/* Process the subject. */
- if (($subject = $mime_headers->getValue('subject'))) {
- require_once 'Horde/Text.php';
- $result['subject'] = Text::htmlSpaces(IMP::filterText($subject));
- } else {
- $result['subject'] = htmlspecialchars(_("[No Subject]"));
- }
+ $result['subject'] = ($subject = $mime_headers->getValue('subject'))
+ ? $imp_ui->getDisplaySubject($subject)
+ : htmlspecialchars(_("[No Subject]"));
/* Get X-Priority. */
$result['priority'] = $imp_ui->getXpriority($mime_headers->getValue('x-priority'));
}
/* Process the subject now. */
-if (($subject = $mime_headers->getValue('subject'))) {
- /* Filter the subject text, if requested. */
- require_once 'Horde/Text.php';
- $subject = IMP::filterText($subject);
- $disp_subject = Text::htmlSpaces($subject);
- $display_headers['subject'] = $disp_subject ? $disp_subject : $subject;
-
+if ($subject = $mime_headers->getValue('subject')) {
+ $display_headers['subject'] = $imp_ui->getDisplaySubject($subject);
$title = sprintf(_("%s: %s"), $page_label, $subject);
$shortsub = htmlspecialchars($subject);
} else {