Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#8887 closed defect (bug) (fixed)

Ticket #6788 broke postmaster attachment handling

Reported by: wwoley's profile wwoley Owned by: westi's profile 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)

#1 @westi
15 years ago

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

#2 @westi
15 years ago

  • Keywords reporter-feedback added; email attachments plugin removed

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

#3 @ryan
15 years ago

  • Component changed from General to Mail

#4 @wwoley
15 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.

#5 @Denis-de-Bernardy
15 years ago

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

#6 @Denis-de-Bernardy
15 years ago

  • Keywords dev-feedback added; reporter-feedback removed

#7 @Denis-de-Bernardy
15 years ago

  • Milestone changed from 2.7.2 to 2.8

#8 @Denis-de-Bernardy
15 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.