Opened 16 years ago
Closed 15 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: | Keywords: | dev-feedback | |
Focuses: | Cc: |
Description
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)
#4
@
16 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 (...)
{
quoted_printable_decode($content);
}
call, but placing it before probably makes more sense.
Ok I've add something in [10412] how does that do?