Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#49033 closed defect (bug) (duplicate)

PHPMailer "basename"

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

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
7 years ago

  • Component GeneralMail

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
7 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
5 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

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.