From b8fd5baef9d11e0e9d759f042ec56b1c9c687a3a Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 25 Nov 2008 22:49:30 -0700 Subject: [PATCH] Add option for no description link by htmlspecialchars() applied. --- imp/lib/Contents.php | 12 ++++++++---- imp/message-mimp.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 3b25db8ec..9aecb92ea 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -19,10 +19,11 @@ class IMP_Contents const SUMMARY_ICON = 4; const SUMMARY_DESCRIP_LINK = 8; const SUMMARY_DESCRIP_NOLINK = 16; - const SUMMARY_DOWNLOAD = 32; - const SUMMARY_DOWNLOAD_ZIP = 64; - const SUMMARY_IMAGE_SAVE = 128; - const SUMMARY_STRIP_LINK = 256; + const SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS = 32; + const SUMMARY_DOWNLOAD = 64; + const SUMMARY_DOWNLOAD_ZIP = 128; + const SUMMARY_IMAGE_SAVE = 256; + const SUMMARY_STRIP_LINK = 512; /* Rendering mask entries. */ const RENDER_FULL = 1; @@ -465,6 +466,7 @@ class IMP_Contents * * IMP_Contents::SUMMARY_DESCRIP_LINK * IMP_Contents::SUMMARY_DESCRIP_NOLINK + * IMP_Contents::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS * Output: parts = 'description' * * IMP_Contents::SUMMARY_DOWNLOAD @@ -548,6 +550,8 @@ class IMP_Contents ? $this->linkViewJS($mime_part, 'view_attach', htmlspecialchars($description), array('jstext' => sprintf(_("View %s [%s]"), $description, $mime_type), 'params' => $param_array)) : htmlspecialchars($description); } elseif ($mask & self::SUMMARY_DESCRIP_NOLINK) { + $part['description'] = htmlspecialchars($description); + } elseif ($mask & self::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS) { $part['description'] = $description; } diff --git a/imp/message-mimp.php b/imp/message-mimp.php index 81595c040..e701f0b81 100644 --- a/imp/message-mimp.php +++ b/imp/message-mimp.php @@ -350,7 +350,7 @@ foreach ($display_headers as $head => $val) { } foreach ($atc_parts as $key) { - $summary = $imp_contents->getSummary($key, IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_DESCRIP_NOLINK); + $summary = $imp_contents->getSummary($key, IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS); $hb->add(new Horde_Mobile_text(_("Attachment") . ': ', array('b'))); $t = &$hb->add(new Horde_Mobile_text(sprintf('%s %s', $summary['description'], $summary['size']) . "\n")); $t->set('linebreaks', true); -- 2.11.0