summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-21 21:11:36 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-21 21:11:36 +0200
commit85788314d64139937b094774aa911809a6bb5f66 (patch)
tree59fbab7b42a609415f0f6c8a872618498723a62f /program/include
parent3f9d1756d12e15d11bd44317b38e8006429fcf69 (diff)
Fix Call to undefined method rcube_mail_header::get() in show_additional_headers plugin (#1488489)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap_generic.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 52459dd78..29dff8613 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -59,6 +59,55 @@ class rcube_mail_header
public $mdn_to;
public $others = array();
public $flags = array();
+
+ // map header to rcube_message_header object property
+ private $obj_headers = array(
+ 'date' => 'date',
+ 'from' => 'from',
+ 'to' => 'to',
+ 'subject' => 'subject',
+ 'reply-to' => 'replyto',
+ 'cc' => 'cc',
+ 'bcc' => 'bcc',
+ 'content-transfer-encoding' => 'encoding',
+ 'in-reply-to' => 'in_reply_to',
+ 'content-type' => 'ctype',
+ 'references' => 'references',
+ 'return-receipt-to' => 'mdn_to',
+ 'disposition-notification-to' => 'mdn_to',
+ 'x-confirm-reading-to' => 'mdn_to',
+ 'message-id' => 'messageID',
+ 'x-priority' => 'priority',
+ );
+
+ /**
+ * Returns header value
+ */
+ public function get($name)
+ {
+ $name = strtolower($name);
+
+ if (isset($this->obj_headers[$name])) {
+ return $this->{$this->obj_headers[$name]};
+ }
+
+ return $this->others[$name];
+ }
+
+ /**
+ * Sets header value
+ */
+ public function set($name, $value)
+ {
+ $name = strtolower($name);
+
+ if (isset($this->obj_headers[$name])) {
+ $this->{$this->obj_headers[$name]} = $value;
+ }
+ else {
+ $this->others[$name] = $value;
+ }
+ }
}
// For backward compatibility with cached messages (#1486602)