From: Michael M Slusarz Date: Thu, 19 Nov 2009 19:01:48 +0000 (-0700) Subject: Bug #8719: Fix List-Post parsing X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4b2f4623ae225c6bb2fb0b514ba039e24d114098;p=horde.git Bug #8719: Fix List-Post parsing --- diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 491a2ad15..568b20991 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -116,6 +116,8 @@ v5.0-git v4.3.6-cvs ---------- +[mms] When replying to list, correctly extract e-mail address if multiple + entries exist in the List-Post header (Bug #8719). [mms] For messages marked as innocent but not moved to Inbox, don't report them as deleted within the current mailbox (Bug #8221). [jan] Don't show address book preference group if address books are disabled diff --git a/imp/lib/UI/Message.php b/imp/lib/UI/Message.php index 9d845a6e3..eb1ed7c44 100644 --- a/imp/lib/UI/Message.php +++ b/imp/lib/UI/Message.php @@ -190,15 +190,21 @@ class IMP_UI_Message } /** - * Parse the information in a mailing list headers. + * Parse the information in mailing list headers. * * @param string $data The header text to process. - * @param boolean $raw Should the raw URL be returned instead of linking - * the header value? + * @param array $opts Additional options: + *
+     * 'email' - (boolean) Only return e-mail values.
+     *           DEFAULT: false
+     * 'raw' - (boolean) Should the raw URL be returned instead of linking
+     *                   the header value?
+     *                   DEFAULT: false
+     * 
* * @return string The header value. */ - public function parseListHeaders($data, $raw = false) + public function parseListHeaders($data, $opts = array()) { $output = ''; @@ -220,7 +226,7 @@ class IMP_UI_Message * that appears in a header that we can adequately handle. */ if (stristr($match, 'mailto:') !== false) { $match = substr($match, strpos($match, ':') + 1); - if ($raw) { + if (!empty($opts['raw'])) { return $match; } $output = Horde::link(IMP::composeLink($match)) . $match . ''; @@ -228,9 +234,9 @@ class IMP_UI_Message $output .= ' ' . $comments[1]; } break; - } else { + } elseif (empty($data['email'])) { if ($url = Horde_Text_Filter::filter($match, 'linkurls', array('callback' => 'Horde::externalUrl'))) { - if ($raw) { + if (!empty($opts['raw'])) { return $match; } $output = $url; @@ -286,7 +292,7 @@ class IMP_UI_Message * list. */ if (($val = $headers->getValue('list-post')) && ($val != 'NO')) { - $ret['reply_list'] = $this->parseListHeaders($val, true); + $ret['reply_list'] = $this->parseListHeaders($val, array('email' => true, 'raw' => true)); } }