Changeset 8578831 in github


Ignore:
Timestamp:
May 21, 2012 3:11:36 PM (12 months ago)
Author:
Aleksander Machniak <alec@…>
Branches:
release-0.8
Children:
6f62715
Parents:
3f9d175
Message:

Fix Call to undefined method rcube_mail_header::get() in show_additional_headers plugin (#1488489)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap_generic.php

    ra57f9e2 r8578831  
    6060    public $others = array(); 
    6161    public $flags = array(); 
     62 
     63    // map header to rcube_message_header object property 
     64    private $obj_headers = array( 
     65        'date'      => 'date', 
     66        'from'      => 'from', 
     67        'to'        => 'to', 
     68        'subject'   => 'subject', 
     69        'reply-to'  => 'replyto', 
     70        'cc'        => 'cc', 
     71        'bcc'       => 'bcc', 
     72        'content-transfer-encoding' => 'encoding', 
     73        'in-reply-to'               => 'in_reply_to', 
     74        'content-type'              => 'ctype', 
     75        'references'                => 'references', 
     76        'return-receipt-to'         => 'mdn_to', 
     77        'disposition-notification-to' => 'mdn_to', 
     78        'x-confirm-reading-to'      => 'mdn_to', 
     79        'message-id'                => 'messageID', 
     80        'x-priority'                => 'priority', 
     81    ); 
     82 
     83    /** 
     84     * Returns header value 
     85     */ 
     86    public function get($name) 
     87    { 
     88        $name = strtolower($name); 
     89 
     90        if (isset($this->obj_headers[$name])) { 
     91            return $this->{$this->obj_headers[$name]}; 
     92        } 
     93 
     94        return $this->others[$name]; 
     95    } 
     96 
     97    /** 
     98     * Sets header value 
     99     */ 
     100    public function set($name, $value) 
     101    { 
     102        $name = strtolower($name); 
     103 
     104        if (isset($this->obj_headers[$name])) { 
     105            $this->{$this->obj_headers[$name]} = $value; 
     106        } 
     107        else { 
     108            $this->others[$name] = $value; 
     109        } 
     110    } 
    62111} 
    63112 
Note: See TracChangeset for help on using the changeset viewer.