Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15458096
D17781.id42746.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17781.id42746.diff
View Options
diff --git a/scripts/mail/mail_handler.php b/scripts/mail/mail_handler.php
--- a/scripts/mail/mail_handler.php
+++ b/scripts/mail/mail_handler.php
@@ -37,14 +37,16 @@
$text_body = $parser->getMessageBody('text');
-$text_body_headers = $parser->getMessageBodyHeaders('text');
-$content_type = idx($text_body_headers, 'content-type');
-if (
- !phutil_is_utf8($text_body) &&
- (preg_match('/charset="(.*?)"/', $content_type, $matches) ||
- preg_match('/charset=(\S+)/', $content_type, $matches))
-) {
- $text_body = phutil_utf8_convert($text_body, 'UTF-8', $matches[1]);
+if ($text_body !== false) {
+ $text_body_headers = $parser->getMessageBodyHeaders('text');
+ $content_type = idx($text_body_headers, 'content-type');
+ if (
+ !phutil_is_utf8($text_body) &&
+ (preg_match('/charset="(.*?)"/', $content_type, $matches) ||
+ preg_match('/charset=(\S+)/', $content_type, $matches))
+ ) {
+ $text_body = phutil_utf8_convert($text_body, 'UTF-8', $matches[1]);
+ }
}
$headers = $parser->getHeaders();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 31, 8:44 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7716047
Default Alt Text
D17781.id42746.diff (1 KB)
Attached To
Mode
D17781: Avoid failing when mail has no plain text part (Ref T12630)
Attached
Detach File
Event Timeline
Log In to Comment