From: Michael M Slusarz Date: Wed, 26 Nov 2008 05:49:30 +0000 (-0700) Subject: Add option for no description link by htmlspecialchars() applied. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b8fd5baef9d11e0e9d759f042ec56b1c9c687a3a;p=horde.git Add option for no description link by htmlspecialchars() applied. --- 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);