Skip to content
Merged
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
7 changes: 6 additions & 1 deletion lib/IMAP/ImapMessageFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,12 @@
if ($utf8 !== false) {
return $utf8;
}
return iconv('UTF-8', 'UTF-8//IGNORE', $subject);
$utf8Ignored = iconv('UTF-8', 'UTF-8//IGNORE', $subject);
if ($utf8Ignored === false) {

Check warning on line 508 in lib/IMAP/ImapMessageFetcher.php

View check run for this annotation

Codecov / codecov/patch

lib/IMAP/ImapMessageFetcher.php#L507-L508

Added lines #L507 - L508 were not covered by tests
// Give up
return $subject;

Check warning on line 510 in lib/IMAP/ImapMessageFetcher.php

View check run for this annotation

Codecov / codecov/patch

lib/IMAP/ImapMessageFetcher.php#L510

Added line #L510 was not covered by tests
}
return $utf8Ignored;

Check warning on line 512 in lib/IMAP/ImapMessageFetcher.php

View check run for this annotation

Codecov / codecov/patch

lib/IMAP/ImapMessageFetcher.php#L512

Added line #L512 was not covered by tests
}

private function parseHeaders(Horde_Imap_Client_Data_Fetch $fetch): void {
Expand Down
8 changes: 2 additions & 6 deletions lib/Service/Avatar/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
$this->clientService = $clientService;
}

/**
* @param string $url
* @return string|null
*/
public function download(string $url) {
public function download(string $url): ?string {
$client = $this->clientService->newClient();

try {
Expand All @@ -37,7 +33,7 @@

$body = $resp->getBody();
if (is_resource($body)) {
return stream_get_contents($body);
return stream_get_contents($body) ?: null;

Check warning on line 36 in lib/Service/Avatar/Downloader.php

View check run for this annotation

Codecov / codecov/patch

lib/Service/Avatar/Downloader.php#L36

Added line #L36 was not covered by tests
}
return $body;
}
Expand Down