From d6798a51897ad0e2759b4f28fd715a6877c9307e Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Thu, 15 Jan 2009 00:55:48 -0500 Subject: [PATCH] use Horde_Imap_Client_Utils --- imp/lib/Compose.php | 10 +++++----- imp/lib/IMAP.php | 9 +++++++++ imp/lib/Mime/Viewer/pgp.php | 2 +- imp/lib/Mime/Viewer/smime.php | 6 +++--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index dfac759bc..a9d880cb1 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -82,7 +82,7 @@ class IMP_Compose /** * Attempts to return a reference to a concrete IMP_Compose instance. * - * If a IMP_Cacheid object exists with the given cacheid, recreate that + * If an IMP_Cacheid object exists with the given cacheid, recreate that * that object. Else, create a new instance. * * @param string $cacheid The cache ID string. @@ -114,7 +114,7 @@ class IMP_Compose * * @param string $cacheid The cache ID string. */ - function __construct($cacheid) + protected function __construct($cacheid) { $this->_cacheid = $cacheid; } @@ -1182,7 +1182,7 @@ class IMP_Compose $subject = $h->getValue('subject'); $header['subject'] = empty($subject) ? 'Re: ' - : 'Re: ' . Horde_Imap_Client::getBaseSubject($subject, array('keepblob' => true)); + : 'Re: ' . $GLOBALS['imp_imap']->utils->getBaseSubject($subject, array('keepblob' => true)); if (in_array($actionID, array('reply', '*'))) { ($header['to'] = $to) || @@ -1357,7 +1357,7 @@ class IMP_Compose $header['subject'] = $h->getValue('subject'); if (!empty($header['subject'])) { $header['title'] = _("Forward") . ': ' . $header['subject']; - $header['subject'] = 'Fwd: ' . Horde_Imap_Client::getBaseSubject($header['subject'], array('keepblob' => true)); + $header['subject'] = 'Fwd: ' . $GLOBALS['imp_imap']->utils->getBaseSubject($header['subject'], array('keepblob' => true)); } else { $header['title'] = _("Forward"); $header['subject'] = 'Fwd:'; @@ -1457,7 +1457,7 @@ class IMP_Compose } elseif (String::length($name) > 80) { $name = String::substr($name, 0, 80) . '...'; } - return 'Fwd: ' . Horde_Imap_Client::getBaseSubject($name, array('keepblob' => true)); + return 'Fwd: ' . $GLOBALS['imp_imap']->utils->getBaseSubject($name, array('keepblob' => true)); } else { return 'Fwd: ' . sprintf(_("%u Forwarded Messages"), $attached); } diff --git a/imp/lib/IMAP.php b/imp/lib/IMAP.php index 529b1f0c7..382bef5e2 100644 --- a/imp/lib/IMAP.php +++ b/imp/lib/IMAP.php @@ -21,6 +21,13 @@ class IMP_IMAP public $ob = null; /** + * The Horde_Imap_Client_Utils object. + * + * @var Horde_Imap_Client_Utils + */ + public $utils = null; + + /** * Is connection read-only? * * @var array @@ -51,6 +58,8 @@ class IMP_IMAP /* Rebuild the Horde_Imap_Client object. */ $this->_loadImapObject(); + + $this->utils = new Horde_Imap_Client_Utils(); } /** diff --git a/imp/lib/Mime/Viewer/pgp.php b/imp/lib/Mime/Viewer/pgp.php index 0824116b9..a5edd66dd 100644 --- a/imp/lib/Mime/Viewer/pgp.php +++ b/imp/lib/Mime/Viewer/pgp.php @@ -319,7 +319,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver if ($GLOBALS['prefs']->getValue('pgp_verify') || Util::getFormData('pgp_verify_msg')) { - $signed_data = Horde_Imap_Client::removeBareNewlines($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true))); + $signed_data = $GLOBALS['imp_imap']->utils->removeBareNewlines($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true))); $sig_part = $this->_params['contents']->getMIMEPart($sig_id); /* Check for the 'x-imp-pgp-signature' param. This is set by the diff --git a/imp/lib/Mime/Viewer/smime.php b/imp/lib/Mime/Viewer/smime.php index 4e2503a2b..a20c8599e 100644 --- a/imp/lib/Mime/Viewer/smime.php +++ b/imp/lib/Mime/Viewer/smime.php @@ -152,7 +152,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver return null; } - $raw_text = Horde_Imap_Client::removeBareNewlines($this->_params['contents']->getBodyPart($this->_mimepart->getMimeId(), array('mimeheaders' => true))); + $raw_text = $GLOBALS['imp_imap']->utils->removeBareNewlines($this->_params['contents']->getBodyPart($this->_mimepart->getMimeId(), array('mimeheaders' => true))); $decrypted_data = $this->_impsmime->decryptMessage($raw_text); if (is_a($decrypted_data, 'PEAR_Error')) { $status[] = $decrypted_data->getMessage(); @@ -173,7 +173,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver return array(); } - $raw_text = Horde_Imap_Client::removeBareNewlines($this->_params['contents']->getBodyPart($this->_miempart->getMimeId(), array('mimeheaders' => true))); + $raw_text = $GLOBALS['imp_imap']->utils->removeBareNewlines($this->_params['contents']->getBodyPart($this->_miempart->getMimeId(), array('mimeheaders' => true))); $sig_result = $this->_impsmime->verifySignature($raw_text); return array( $this->_mimepart->getMimeId() => array( @@ -233,7 +233,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver $raw_text = $base_id ? $this->_params['contents']->getBodyPart($base_id, array('mimeheaders' => true)) : $this->_params['contents']->fullMessageText(); - $raw_text = Horde_Imap_Client::removeBareNewlines($raw_text); + $raw_text = $GLOBALS['imp_imap']->utils->removeBareNewlines($raw_text); $sig_result = null; -- 2.11.0