Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .coveralls.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified autoload.php
100644 → 100755
Empty file.
Empty file modified composer.json
100644 → 100755
Empty file.
Empty file modified phpunit.xml.dist
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions src/Fetch/Attachment.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public function getData()
{
if (!isset($this->data)) {
$messageBody = isset($this->partId) ?
imap_fetchbody($this->imapStream, $this->messageId, $this->partId, FT_UID)
: imap_body($this->imapStream, $this->messageId, FT_UID);
imap_fetchbody($this->imapStream, $this->messageId, $this->partId, FT_UID | FT_PEEK)
: imap_body($this->imapStream, $this->messageId, FT_UID | FT_PEEK);

$messageBody = Message::decode($messageBody, $this->encoding);
$this->data = $messageBody;
Expand Down Expand Up @@ -220,8 +220,8 @@ public function saveAs($path)

// Fix an issue causing server to throw an error
// See: https://github.com/tedious/Fetch/issues/74 for more details
$fetch = imap_fetchbody($this->imapStream, $this->messageId, $this->partId ?: 1, FT_UID);
$result = imap_savebody($this->imapStream, $filePointer, $this->messageId, $this->partId ?: 1, FT_UID);
$fetch = imap_fetchbody($this->imapStream, $this->messageId, $this->partId ?: 1, FT_UID | FT_PEEK);
$result = imap_savebody($this->imapStream, $filePointer, $this->messageId, $this->partId ?: 1, FT_UID | FT_PEEK);

if ($streamFilter) {
stream_filter_remove($streamFilter);
Expand All @@ -234,6 +234,6 @@ public function saveAs($path)

protected function setFileName($text)
{
$this->filename = MIME::decode($text, Message::$charset);
$this->filename = str_replace(DIRECTORY_SEPARATOR, '_', MIME::decode($text, Message::$charset));
}
}
Empty file modified src/Fetch/MIME.php
100644 → 100755
Empty file.
Empty file modified src/Fetch/Server.php
100644 → 100755
Empty file.
Empty file modified tests/Fetch/Test/AttachmentTest.php
100644 → 100755
Empty file.
Empty file modified tests/Fetch/Test/MIMETest.php
100644 → 100755
Empty file.
Empty file modified tests/Fetch/Test/MessageTest.php
100644 → 100755
Empty file.
Empty file modified tests/Fetch/Test/ServerTest.php
100644 → 100755
Empty file.
Empty file modified tests/bootstrap.php
100644 → 100755
Empty file.