annotate program/lib/Roundcube/rcube_message_part.php @ 25:bea5a38be938

More cleaning up php8 Warnings/deprecations
author Charlie Root
date Sat, 18 Oct 2025 12:24:31 -0400
parents 303b85d5b561
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
1 <?php
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
2
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
3 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
4 +-----------------------------------------------------------------------+
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
5 | This file is part of the Roundcube Webmail client |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
6 | Copyright (C) 2005-2012, The Roundcube Dev Team |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
7 | Copyright (C) 2011-2012, Kolab Systems AG |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
8 | |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
9 | Licensed under the GNU General Public License version 3 or |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
10 | any later version with exceptions for skins & plugins. |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
11 | See the README file for a full license statement. |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
12 | |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
13 | PURPOSE: |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
14 | Class representing a message part |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
15 +-----------------------------------------------------------------------+
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
16 | Author: Thomas Bruederli <roundcube@gmail.com> |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
17 | Author: Aleksander Machniak <alec@alec.pl> |
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
18 +-----------------------------------------------------------------------+
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
19 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
20
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
21 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
22 * Class representing a message part
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
23 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
24 * @package Framework
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
25 * @subpackage Storage
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
26 * @author Thomas Bruederli <roundcube@gmail.com>
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
27 * @author Aleksander Machniak <alec@alec.pl>
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
28 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
29 class rcube_message_part
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
30 {
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
31 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
32 * Part MIME identifier
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
33 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
34 * @var string
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
35 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
36 public $mime_id = '';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
37
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
38 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
39 * Content main type
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
40 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
41 * @var string
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
42 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
43 public $ctype_primary = 'text';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
44
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
45 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
46 * Content subtype
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
47 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
48 * @var string
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
49 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
50 public $ctype_secondary = 'plain';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
51
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
52 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
53 * Complete content type
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
54 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
55 * @var string
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
56 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
57 public $mimetype = 'text/plain';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
58
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
59 /**
25
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
60 * Real content type (for fake parts)
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
61 *
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
62 * @var string|null
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
63 */
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
64 public $realtype;
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
65
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
66 /**
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
67 * Real content type of a message/rfc822 part
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
68 *
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
69 * @var string
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
70 */
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
71 public $real_mimetype = '';
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
72
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
73 /**
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
74 * Part size in bytes
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
75 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
76 * @var int
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
77 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
78 public $size = 0;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
79
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
80 /**
25
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
81 * Part body
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
82 *
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
83 * @var string|null
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
84 */
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
85 public $body;
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
86
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
87 /**
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
88 * Part headers
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
89 *
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
90 * @var array
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
91 */
25
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
92 public $headers = [];
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
93
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
94 /**
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
95 * Sub-Parts
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
96 *
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
97 * @var array
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
98 */
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
99 public $parts = [];
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
100
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
101 /**
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
102 * Part Content-Id
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
103 *
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
104 * @var string|null
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
105 */
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
106 public $content_id;
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
107
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
108 /**
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
109 * Part Content-Location
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
110 *
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
111 * @var string|null
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
112 */
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
113 public $content_location;
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
114
19
b6a96bdd6b29 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 0
diff changeset
115 public $type;
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
116 public $disposition = '';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
117 public $filename = '';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
118 public $encoding = '8bit';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
119 public $charset = '';
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
120 public $d_parameters = array();
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
121 public $ctype_parameters = array();
22
303b85d5b561 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 19
diff changeset
122 public $replaces = [];
25
bea5a38be938 More cleaning up php8 Warnings/deprecations
Charlie Root
parents: 22
diff changeset
123 public $body_modified = false;
0
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
124
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
125 /**
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
126 * Clone handler.
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
127 */
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
128 function __clone()
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
129 {
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
130 if (isset($this->parts)) {
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
131 foreach ($this->parts as $idx => $part) {
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
132 if (is_object($part)) {
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
133 $this->parts[$idx] = clone $part;
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
134 }
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
135 }
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
136 }
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
137 }
4681f974d28b vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
138 }