From 9259ff73bd2ac1e5630e89413e85f29427cc21dc Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 11 Sep 2024 18:13:07 +0200 Subject: [PATCH] DEBUG --- .github/workflows/tests.yml | 4 ++-- src/PHPMailer.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 54baa792c..d033c1ff0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -210,11 +210,11 @@ jobs: - name: Run tests, no code coverage if: ${{ matrix.coverage == false || github.repository != 'PHPMailer/PHPMailer' }} - run: ./vendor/bin/phpunit --no-coverage + run: ./vendor/bin/phpunit --no-coverage --testdox --filter PunyencodeAddressTest - name: Run tests with code coverage if: ${{ matrix.coverage == true && github.repository == 'PHPMailer/PHPMailer' }} - run: vendor/bin/phpunit + run: vendor/bin/phpunit --testdox --filter PunyencodeAddressTest - name: Send coverage report to Codecov if: ${{ success() && matrix.coverage == true && github.repository == 'PHPMailer/PHPMailer' }} diff --git a/src/PHPMailer.php b/src/PHPMailer.php index 1ca6d399e..53159e02b 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -1472,14 +1472,17 @@ public function punyencodeAddress($address) false !== $pos && static::idnSupported() ) { +echo __LINE__, ' - in if condition', PHP_EOL; $domain = substr($address, ++$pos); //Verify CharSet string is a valid one, and domain properly encoded in this CharSet. if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { +echo __LINE__, ' - in second if condition', PHP_EOL; //Convert the domain from whatever charset it's in to UTF-8 $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet); //Ignore IDE complaints about this line - method signature changed in PHP 5.4 $errorcode = 0; if (defined('INTL_IDNA_VARIANT_UTS46')) { +echo __LINE__, ' - in INTL_IDNA_VARIANT_UTS46 condition', PHP_EOL; //Use the current punycode standard (appeared in PHP 7.2) $punycode = idn_to_ascii( $domain, @@ -1488,18 +1491,22 @@ public function punyencodeAddress($address) \INTL_IDNA_VARIANT_UTS46 ); } elseif (defined('INTL_IDNA_VARIANT_2003')) { +echo __LINE__, ' - in INTL_IDNA_VARIANT_2003 condition', PHP_EOL; //Fall back to this old, deprecated/removed encoding $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); } else { +echo __LINE__, ' - in fallback condition', PHP_EOL; //Fall back to a default we don't know about $punycode = idn_to_ascii($domain, $errorcode); } if (false !== $punycode) { +echo __LINE__, ' - returning based on punycode not false', PHP_EOL; return substr($address, 0, $pos) . $punycode; } } } +echo __LINE__, ' - fall back return', PHP_EOL; return $address; }