Skip to content

Commit

Permalink
Unpin version for symfony/polyfill-intl-idn (#2678)
Browse files Browse the repository at this point in the history
* Unpin version for symfony/polyfill-intl-idn

* minor

* typo

* Added changelgo
  • Loading branch information
Nyholm committed Jun 6, 2020
1 parent a4a1b69 commit 23730ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log

## 6.5.5 - UNRELEASED

* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678)

## 6.5.4 - 2020-05-25

* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -23,7 +23,7 @@
"require": {
"php": ">=5.5",
"ext-json": "*",
"symfony/polyfill-intl-idn": "1.17.0",
"symfony/polyfill-intl-idn": "^1.17.0",
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.6.1"
},
Expand Down
9 changes: 6 additions & 3 deletions src/Utils.php
Expand Up @@ -81,9 +81,12 @@ private static function idnToAsci($domain, $options, &$info = [])
}

/*
* The Idn class is marked as @internal. We've locked the version to
* symfony/polyfill-intl-idn to avoid issues in the future.
* The Idn class is marked as @internal. Verify that class and method exists.
*/
return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info);
if (method_exists(Idn::class, 'idn_to_ascii')) {
return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info);
}

throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old');
}
}

0 comments on commit 23730ab

Please sign in to comment.