[wp-trac] [WordPress Trac] #53393: Latest version of PHPMailer no longer attaches files to emails
WordPress Trac
noreply at wordpress.org
Mon Aug 2 03:59:59 UTC 2021
#53393: Latest version of PHPMailer no longer attaches files to emails
---------------------------+---------------------
Reporter: threeatetwo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8.1
Component: Mail | Version: 5.7.2
Severity: normal | Resolution:
Keywords: needs-testing | Focuses:
---------------------------+---------------------
Comment (by peterwilsoncc):
Introduced in [50799] and [50800] for #53114. If I recall correctly, some
of these changes were ported in to earlier versions of WP too.
Given the relative popularity of using streams in WP (s3 and other storage
bucket plugins are quite popular), I'd like to support streams for
attaching files to email.
I'm hesitant about something as simple as:
{{{#!php
<?php
if ( is_wp_stream( /* file */ ) ) {
$phpmailer->addStringAttachment( file_get_contents( /* file */ ) );
}
}}}
Such code include HTTP, FTP and several similar protocols by default.
Essentially reintroducing to WP the problem the PHPMailer library was
trying to avoid.
It's WP's prerogative to loosen the restrictions on streams to account for
acceptable and safe use within the user base, care will need to be taken
not to loosen the restrictions too far.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53393#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list