Skip to content

Commit

Permalink
Fix incorrect use of rcube_utils::explode()
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jan 28, 2024
1 parent 9e5c019 commit c47accb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,6 @@ parameters:
count: 1
path: program/lib/Roundcube/rcube_ldap.php

-
message: "#^Static method rcube_utils\\:\\:explode\\(\\) invoked with 3 parameters, 2 required\\.$#"
count: 1
path: program/lib/Roundcube/rcube_message.php

-
message: "#^Variable \\$charsets might not be defined\\.$#"
count: 1
Expand Down
8 changes: 6 additions & 2 deletions program/lib/Roundcube/rcube_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,12 @@ private function parse_structure($structure, $recursive = false)

// parse headers from message/rfc822 part
if (!isset($structure->headers['subject']) && !isset($structure->headers['from'])) {
$part_body = $this->get_part_body($structure->mime_id, false, 32768);
[$headers] = rcube_utils::explode("\r\n\r\n", $part_body, 2);
$part_body = $headers = $this->get_part_body($structure->mime_id, false, 32768);

if (($pos = strpos($headers, "\r\n\r\n")) !== false) {
$headers = substr($headers, $pos);
}

$structure->headers = rcube_mime::parse_headers($headers);

if ($this->context === $structure->mime_id) {
Expand Down

0 comments on commit c47accb

Please sign in to comment.