bug72506.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #72506 (idn_to_ascii with INTL_IDNA_VARIANT_UTS46 fatals for long domain names)
  3. --DESCRIPTION--
  4. Actually, the $info array should be populated for these cases, but at least it's
  5. not clear yet with which values exactly.
  6. --SKIPIF--
  7. <?php
  8. if (!extension_loaded('intl')) die('skip this test requires ext/intl');
  9. if (!defined('INTL_IDNA_VARIANT_UTS46')) die('skip no UTS #46 API');
  10. ?>
  11. --FILE--
  12. <?php
  13. // ASCII domain name with 255 characters
  14. $domain = str_repeat('a.', 126) . 'aaa';
  15. $result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
  16. var_dump($result, $info);
  17. // ASCII domain name with 256 characters – one character added
  18. $domain .= 'a';
  19. $result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
  20. var_dump($result, $info);
  21. // International domain name with cyrillic "ф" characters
  22. $domain = str_repeat('ф.', 32) . 'a';
  23. $result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
  24. var_dump($result, $info);
  25. ?>
  26. --EXPECT--
  27. bool(false)
  28. array(0) {
  29. }
  30. bool(false)
  31. array(0) {
  32. }
  33. bool(false)
  34. array(0) {
  35. }