mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 23:55:55 +08:00
Resolve #331
This commit is contained in:
parent
0256f05e7d
commit
fd28741cb8
|
@ -57,6 +57,11 @@ class Literal
|
|||
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
|
||||
{
|
||||
$this->iPos = 0;
|
||||
|
|
|
@ -720,7 +720,7 @@ class GPG
|
|||
|
||||
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.');
|
||||
}
|
||||
|
||||
|
@ -904,6 +904,14 @@ class GPG
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1150,7 +1158,7 @@ class GPG
|
|||
$inputStreams,
|
||||
$outputStreams,
|
||||
$exceptionStreams,
|
||||
null
|
||||
5
|
||||
);
|
||||
|
||||
$this->_debug('=> got ' . $ready);
|
||||
|
|
Loading…
Reference in a new issue