From cb2179828a9f612f67e44da1dc4e452c275bcd0d Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Mon, 27 May 2019 21:33:40 +0200 Subject: [PATCH] Use locale-safe basename function everywhere, fixes #1736 --- src/PHPMailer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PHPMailer.php b/src/PHPMailer.php index 9eb355f3..2c1bc288 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -2847,7 +2847,7 @@ class PHPMailer $type = static::filenameToType($path); } - $filename = basename($path); + $filename = static::mb_pathinfo($path, PATHINFO_BASENAME); if ('' == $name) { $name = $filename; } @@ -3417,7 +3417,7 @@ class PHPMailer throw new Exception($this->lang('encoding') . $encoding); } - $filename = basename($path); + $filename = static::mb_pathinfo($path, PATHINFO_BASENAME); if ('' == $name) { $name = $filename; } @@ -3904,7 +3904,7 @@ class PHPMailer // Do not change absolute URLs, including anonymous protocol and !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) ) { - $filename = basename($url); + $filename = static::mb_pathinfo($url, PATHINFO_BASENAME); $directory = dirname($url); if ('.' == $directory) { $directory = '';