Skip to content

Commit 026a459

Browse files
Merge pull request #194 from bakame-php/develop
patch idn_to_utf8 for PHP 7.2
2 parents c706854 + 195cde3 commit 026a459

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Pdp/Parser.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,11 @@ protected function normalize($part)
337337
protected function denormalize($part)
338338
{
339339
if ($this->isNormalized === true) {
340-
$part = idn_to_utf8($part);
340+
if (defined('INTL_IDNA_VARIANT_UTS46')) {
341+
$part = idn_to_utf8($part, 0, INTL_IDNA_VARIANT_UTS46);
342+
} else {
343+
$part = idn_to_utf8($part);
344+
}
341345
$this->isNormalized = false;
342346
}
343347

0 commit comments

Comments
 (0)