mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #331
This commit is contained in:
parent
0256f05e7d
commit
fd28741cb8
2 changed files with 15 additions and 2 deletions
|
|
@ -57,6 +57,11 @@ class Literal
|
||||||
return \fopen(self::STREAM_NAME.'://'.$sHashName, 'rb');
|
return \fopen(self::STREAM_NAME.'://'.$sHashName, 'rb');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function stream_cast(int $cast_as) /*: resource*/
|
||||||
|
{
|
||||||
|
return false; // $this->rStream;
|
||||||
|
}
|
||||||
|
|
||||||
public function stream_open(string $sPath) : bool
|
public function stream_open(string $sPath) : bool
|
||||||
{
|
{
|
||||||
$this->iPos = 0;
|
$this->iPos = 0;
|
||||||
|
|
|
||||||
|
|
@ -720,7 +720,7 @@ class GPG
|
||||||
|
|
||||||
protected function _sign(/*string|resource*/ $input, /*string|resource*/ $output = null, bool $textmode = true) /*: string|false*/
|
protected function _sign(/*string|resource*/ $input, /*string|resource*/ $output = null, bool $textmode = true) /*: string|false*/
|
||||||
{
|
{
|
||||||
if (!$this->hasSignKeys()) {
|
if (empty($this->signKeys)) {
|
||||||
throw new \Exception('No signing keys specified.');
|
throw new \Exception('No signing keys specified.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -904,6 +904,14 @@ class GPG
|
||||||
|
|
||||||
private function setInput(&$input) : void
|
private function setInput(&$input) : void
|
||||||
{
|
{
|
||||||
|
if (\is_resource($input)) {
|
||||||
|
// https://github.com/the-djmaze/snappymail/issues/331
|
||||||
|
// $meta['stream_type'] == MEMORY or $meta['wrapper_data'] == MailSo\Base\StreamWrappers\Literal
|
||||||
|
$meta = \stream_get_meta_data($input);
|
||||||
|
if ('STDIO' != $meta['stream_type']) {
|
||||||
|
$input = \stream_get_contents($input);
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->_input =& $input;
|
$this->_input =& $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1150,7 +1158,7 @@ class GPG
|
||||||
$inputStreams,
|
$inputStreams,
|
||||||
$outputStreams,
|
$outputStreams,
|
||||||
$exceptionStreams,
|
$exceptionStreams,
|
||||||
null
|
5
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->_debug('=> got ' . $ready);
|
$this->_debug('=> got ' . $ready);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue