OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress_backup
/
vendor
/
phpmailer
/
phpmailer
/
test
/
PHPMailer
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
π
..
-
05/19/2025 10:07:17 AM
rwxr-xr-x
π
AddEmbeddedImageTest.php
6.45 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
AddStringAttachmentTest.php
5.19 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
AddStringEmbeddedImageTest.php
5.53 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
AddrFormatTest.php
2.08 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
AuthCRAMMD5Test.php
1.54 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
CustomHeaderTest.php
9.2 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
DKIMTest.php
9.51 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
DSNConfiguratorTest.php
6.49 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
EncodeQTest.php
3.96 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
EncodeStringTest.php
4.58 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
FileIsAccessibleTest.php
3.32 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
FilenameToTypeTest.php
2.22 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
GenerateIdTest.php
2.63 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
GetLastMessageIDTest.php
3.32 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
HasLineLongerThanMaxTest.php
4.69 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
Html2TextTest.php
9.79 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
ICalTest.php
4.32 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
IsPermittedPathTest.php
3.74 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
IsValidHostTest.php
4.18 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
LocalizationTest.php
18.51 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
MailTransportTest.php
3.67 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
MbPathinfoTest.php
5.74 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
MimeTypesTest.php
1.93 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
NormalizeBreaksTest.php
3.62 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
PHPMailerTest.php
47.39 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
ParseAddressesTest.php
14.27 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
PunyencodeAddressTest.php
4.77 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
QuotedStringTest.php
2.08 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
ReplyToGetSetClearTest.php
17.23 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
SetErrorTest.php
5.19 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
SetFromTest.php
7.08 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
SetTest.php
2.32 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
SetWordWrapTest.php
4.01 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
Utf8CharBoundaryTest.php
1.95 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
ValidateAddressCustomValidatorTest.php
3.65 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
ValidateAddressTest.php
17.2 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
WrapTextTest.php
6.05 KB
05/19/2025 10:07:17 AM
rw-r--r--
π
XMailerTest.php
2 KB
05/19/2025 10:07:17 AM
rw-r--r--
Editing: PunyencodeAddressTest.php
Close
<?php /** * PHPMailer - PHP email transport unit tests. * PHP version 5.5. * * @author Marcus Bointon <phpmailer@synchromedia.co.uk> * @author Andy Prevost * @copyright 2012 - 2020 Marcus Bointon * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace PHPMailer\Test\PHPMailer; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\Test\TestCase; /** * Test IDN to ASCII functionality. * * @covers \PHPMailer\PHPMailer\PHPMailer::punyencodeAddress */ final class PunyencodeAddressTest extends TestCase { /** * Test IDN to ASCII form/punycode conversion for an email address. * * @requires extension mbstring * @requires function idn_to_ascii * * @dataProvider dataPunyencodeAddressConversion * * @param string $input Input text string. * @param string $charset The character set. * @param string $expected Expected function output. */ public function testPunyencodeAddressConversion($input, $charset, $expected) { $this->Mail->CharSet = $charset; $input = html_entity_decode($input, ENT_COMPAT, $charset); $expected = html_entity_decode($expected, ENT_COMPAT, $charset); $result = $this->Mail->punyencodeAddress($input); $this->assertSame($expected, $result); } /** * Data provider. * * @return array */ public function dataPunyencodeAddressConversion() { return [ // This source file is in UTF-8, so characters here are in native charset. 'UTF8' => [ 'input' => 'test@françois.ch', 'charset' => PHPMailer::CHARSET_UTF8, 'expected' => 'test@xn--franois-xxa.ch', ], // To force working another charset, decode an ASCII string to avoid literal string charset issues. 'ISO88591' => [ 'input' => 'test@françois.ch', 'charset' => PHPMailer::CHARSET_ISO88591, 'expected' => 'test@xn--franois-xxa.ch', ], 'Decode only domain' => [ 'input' => 'françois@françois.ch', 'charset' => PHPMailer::CHARSET_UTF8, 'expected' => 'françois@xn--franois-xxa.ch', ], 'IDN conversion flags' => [ 'input' => 'test@fuΓball.test', 'charset' => PHPMailer::CHARSET_UTF8, 'expected' => 'test@xn--fuball-cta.test', ], ]; } /** * Test IDN to ASCII form/punycode conversion returns the original value when no conversion * is needed or when the requirements to convert an address have not been met. * * @dataProvider dataPunyencodeAddressNoConversion * * @param string $input Input text string. * @param string $charset The character set. * @param string $expected Expected function output. */ public function testPunyencodeAddressNoConversion($input, $charset, $expected) { $this->Mail->CharSet = $charset; // Prevent a warning about html_entity_decode() not supporting charset `us-ascii`. if ($charset !== PHPMailer::CHARSET_ASCII) { $input = html_entity_decode($input, ENT_COMPAT, $charset); $expected = html_entity_decode($expected, ENT_COMPAT, $charset); } $result = $this->Mail->punyencodeAddress($input); $this->assertSame($expected, $result); } /** * Data provider. * * @return array */ public function dataPunyencodeAddressNoConversion() { return [ 'ASCII' => [ 'input' => 'test@example.com', 'charset' => PHPMailer::CHARSET_ASCII, 'expected' => 'test@example.com', ], 'Invalid email address' => [ 'input' => 'françois@', 'charset' => PHPMailer::CHARSET_UTF8, 'expected' => 'françois@', ], 'Not an email address' => [ 'input' => 'testing 1-2-3', 'charset' => PHPMailer::CHARSET_UTF8, 'expected' => 'testing 1-2-3', ], 'Empty string' => [ 'input' => '', 'charset' => PHPMailer::CHARSET_UTF8, 'expected' => '', ], 'Empty charset' => [ 'input' => 'test@françois.ch', 'charset' => '', 'expected' => 'test@françois.ch', ], ]; } }