1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of the ZBateson\MailMimeParser project. |
4
|
|
|
* |
5
|
|
|
* @license http://opensource.org/licenses/bsd-license.php BSD |
6
|
|
|
*/ |
7
|
|
|
namespace ZBateson\MailMimeParser\Message; |
8
|
|
|
|
9
|
|
|
use ZBateson\MailMimeParser\Message\PartStreamContainer; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Implementation of a non-mime message's uuencoded attachment part. |
13
|
|
|
* |
14
|
|
|
* @author Zaahid Bateson |
15
|
|
|
*/ |
16
|
|
|
class UUEncodedPart extends NonMimePart implements IUUEncodedPart |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @var int the unix file permission |
20
|
|
|
*/ |
21
|
|
|
protected $mode = null; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string the name of the file in the uuencoding 'header'. |
25
|
|
|
*/ |
26
|
|
|
protected $filename = null; |
27
|
|
|
|
28
|
|
|
public function __construct($mode = null, $filename = null, IMimePart $parent = null, PartStreamContainer $streamContainer = null) |
29
|
|
|
{ |
30
|
|
|
if ($streamContainer === null) { |
31
|
|
|
$di = MailMimeParser::getDependencyContainer(); |
|
|
|
|
32
|
|
|
$streamContainer = $di['ZBateson\MailMimeParser\Message\PartStreamContainer']; |
33
|
|
|
$streamFactory = $di['ZBateson\MailMimeParser\Stream\StreamFactory']; |
34
|
|
|
$streamContainer->setStream($streamFactory->newMessagePartStream($this)); |
35
|
|
|
} |
36
|
|
|
parent::__construct( |
37
|
|
|
$streamContainer, |
38
|
|
|
$parent |
39
|
|
|
); |
40
|
|
|
$this->mode = $mode; |
41
|
|
|
$this->filename = $filename; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Returns the filename included in the uuencoded 'begin' line for this |
46
|
|
|
* part. |
47
|
|
|
* |
48
|
|
|
* @return string |
49
|
|
|
*/ |
50
|
|
|
public function getFilename() |
51
|
|
|
{ |
52
|
|
|
return $this->filename; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function setFilename($filename) |
56
|
|
|
{ |
57
|
|
|
$this->filename = $filename; |
58
|
|
|
$this->notify(); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Returns false. |
63
|
|
|
* |
64
|
|
|
* Although the part may be plain text, there is no reliable way of |
65
|
|
|
* determining its type since uuencoded 'begin' lines only include a file |
66
|
|
|
* name and no mime type. The file name's extension may be a hint. |
67
|
|
|
* |
68
|
|
|
* @return bool |
69
|
|
|
*/ |
70
|
|
|
public function isTextPart() |
71
|
|
|
{ |
72
|
|
|
return false; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Returns 'application/octet-stream'. |
77
|
|
|
* |
78
|
|
|
* @return string |
79
|
|
|
*/ |
80
|
|
|
public function getContentType($default = 'application/octet-stream') |
81
|
|
|
{ |
82
|
|
|
return 'application/octet-stream'; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Returns null |
87
|
|
|
* |
88
|
|
|
* @return string |
89
|
|
|
*/ |
90
|
|
|
public function getCharset() |
91
|
|
|
{ |
92
|
|
|
return null; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* Returns 'attachment'. |
97
|
|
|
* |
98
|
|
|
* @return string |
99
|
|
|
*/ |
100
|
|
|
public function getContentDisposition($default = 'attachment') |
101
|
|
|
{ |
102
|
|
|
return 'attachment'; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Returns 'x-uuencode'. |
107
|
|
|
* |
108
|
|
|
* @return string |
109
|
|
|
*/ |
110
|
|
|
public function getContentTransferEncoding($default = 'x-uuencode') |
111
|
|
|
{ |
112
|
|
|
return 'x-uuencode'; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
public function getUnixFileMode() |
116
|
|
|
{ |
117
|
|
|
return $this->mode; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
public function setUnixFileMode($mode) |
121
|
|
|
{ |
122
|
|
|
$this->mode = $mode; |
123
|
|
|
$this->notify(); |
124
|
|
|
} |
125
|
|
|
} |
126
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths