WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 6 months ago

#49033 closed defect (bug) (duplicate)

PHPMailer "basename"

Reported by: northmule Owned by:
Milestone: 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 (3)

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

#3 @ocean90
6 months 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.