Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#49033 closed defect (bug) (duplicate)

PHPMailer "basename"

Reported by: northmule's profile northmule Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:


When sending attached files in Cyrillic encoding, the file name is truncated. This is because in class "PHPMailer", functions "addAttachment" use "basename". Maybe you should use the WordPress feature in this place wp_basename.
For example, when sending a file through function wp_mail, we specify the file name / path / Файл.pdf - As a result, the file reaches the addressee ".pdf"

Change History (3)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to Mail

Hi there, welcome to WordPress Trac! Thanks for the ticket.

To clarify a bit, PHPMailer is an external library, so wp_basename() cannot be used there. Some other solution would need to be explored.

#2 @northmule
4 years ago

Yes, thank you for your answer. The solution of course in this case would be to call setlocale(LC_CTYPE, 'ru_RU.utf8') before wp_mail

#3 @ocean90
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This bug was already reported in #31775 and is related to #28407 which should make it possible to use a custom encoding function like wp_basename() for attachment names.

Note: See TracTickets for help on using tickets.