Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#8887 closed defect (bug) (fixed)

Ticket #6788 broke postmaster attachment handling

Reported by: wwoley Owned by: westi
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7
Component: Mail Keywords: dev-feedback
Focuses: Cc:


Under ticket #6788 for version 2.7 in file wp-mail.php, the following code was added to transform the content from one character set to another.

if ( function_exists('iconv') && ! empty( $charset ) ) {

$content = iconv($charset, get_option('blog_charset'), $content);


The postmaster plugin relied on getting the multipart mime message so it could save off an image and video attachment and add the appropriate code to reference it. The problem is that the added code seems to assume that the message is non mime encoded. One this code is run, the content of a mime encoded email is empty. This would impact the ability of any plugin to handle mime encoded emails.

Perhaps the line

$post_content = apply_filters('phone_content', $content);

could be moved above the iconv line so that only text remaining after the filter would be affected. Another idea would be to put another filter before this section specifically to handle multipart mime content

$post_content = apply_filters('mutipart_mime_content', $content);

for instance. In the event that wordpress does add the ability to natively handle multipart mime, this would give users a chance to override the functionality with plugins.

Change History (8)

comment:1 @westi7 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

comment:2 @westi7 years ago

  • Keywords reporter-feedback added; email attachments plugin removed

Ok I've add something in [10412] how does that do?

comment:3 @ryan7 years ago

  • Component changed from General to Mail

comment:4 @wwoley7 years ago

I think the placement there will work, but I think we should probably un-break any plugins that were broken by the insertion of the

if ( function_exists('iconv') && ! empty( $charset ) ) {

$content = iconv($charset, get_option('blog_charset'), $content);


line first by moving the original-named filter back near the original location. (I know the additional filter was my idea) That would probably be the best action for now and would allow broken plugins to start working again with the patch. So maybe you can just move the

$post_content = apply_filters('phone_content', $content);

line to that same location, keeping the the comments so future developers know why it's located there and not somewhere else.

Previously, the filter line was after the

if (...)

call, but placing it before probably makes more sense.

comment:5 @Denis-de-Bernardy6 years ago

plugins in question have presumably been broken for 3 months now. wontfix?

comment:6 @Denis-de-Bernardy6 years ago

  • Keywords dev-feedback added; reporter-feedback removed

comment:7 @Denis-de-Bernardy6 years ago

  • Milestone changed from 2.7.2 to 2.8

comment:8 @Denis-de-Bernardy6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Closing this as fixed based on user's feedback.

Note: See TracTickets for help on using tickets.