WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#49033 new defect (bug)

PHPMailer "basename"

Reported by: northmule Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:

Description

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 (2)

#1 @SergeyBiryukov
2 months 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
2 months 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

Note: See TracTickets for help on using tickets.