Skip to content

Conversation

gitstashgithub
Copy link

Some systems allow slash(/) in attachment file name, and it causes issue in IncomingMailAttachment::saveToDisk() function. The \file_put_contents() function cannot handle it and throws error
Failed to open stream: No such file or directory

Some systems allow slash(/) in attachment file name, and it causes issue in IncomingMailAttachment::saveToDisk() function. The \file_put_contents() function cannot handle it and throws error
Failed to open stream: No such file or directory
$fileName = $this->decodeMimeStr($fileName);
$fileName = $this->decodeRFC2231($fileName);
}
$fileName = str_replace('/', ' ', $fileName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would feel better, if we would use a underscore instead of a whitespace as whitespaces can also result in unexpected behaviours.

Suggested change
$fileName = str_replace('/', ' ', $fileName);
$fileName = str_replace('/', '_', $fileName);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants