Skip to content

Commit

Permalink
Update mime_encode.php
Browse files Browse the repository at this point in the history
fix: error `PHP message: PHP Fatal error:  Uncaught TypeError: strcasecmp(): Argument Z-Hub#1 ($string1) must be of type string`

There is `is_array($value)` in default case, so, it needs `is_string` to detect.
  • Loading branch information
dallaslu authored Jul 4, 2024
1 parent f9566f6 commit 56a2336
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/imap/mime_encode.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function build_mime_message($message) {
$mimeHeaders['content_type'] = $new_value;
break;
case 'content-transfer-encoding':
if (strcasecmp($value, "base64") == 0 || strcasecmp($value, "binary") == 0) {
if (is_string($value) && (strcasecmp($value, "base64") == 0 || strcasecmp($value, "binary") == 0)) {
$mimeHeaders['encoding'] = "base64";
}
else {
Expand Down Expand Up @@ -325,4 +325,4 @@ function is_encrypted($message) {
*/
function is_multipart($message) {
return isset($message->ctype_primary) && $message->ctype_primary == "multipart";
}
}

0 comments on commit 56a2336

Please sign in to comment.