[php-src] PR #23533: ext/intl: report argument #3 ($variant) for an invalid IDNA variant
| From: | lacatoire | Date: | Tue, 01 Sep 2026 18:52:46 +0000 |
| Subject: | [php-src] PR #23533: ext/intl: report argument #3 ($variant) for an invalid IDNA variant | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38254@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23533
Author: lacatoire
php_intl_idn_handoff() parses $domain, $flags,
$variant, so the variant check must report argument 3. It hardcodes 2, so
idn_to_ascii() and idn_to_utf8() blame $flags for a value
that was passed as $variant.
Before:
```
ValueError: idn_to_ascii(): Argument #2 ($flags) must be INTL_IDNA_VARIANT_UTS46
```
After:
```
ValueError: idn_to_ascii(): Argument #3 ($variant) must be INTL_IDNA_VARIANT_UTS46
```
Only the error message changes. The existing test is updated and a named-argument case is added,
where the wrong number was the most misleading.