From 301ea663714f747b6a34031207ca7cb31c1505fe Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 17 May 2016 11:48:58 +0100 Subject: [PATCH] Use silencer and check the function exists, refs #5317 --- src/Composer/Repository/PlatformRepository.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index d103fe8dc..02d668469 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -17,6 +17,7 @@ use Composer\Package\PackageInterface; use Composer\Package\CompletePackage; use Composer\Package\Version\VersionParser; use Composer\Plugin\PluginInterface; +use Composer\Util\Silencer; /** * @author Jordi Boggiano @@ -88,9 +89,9 @@ class PlatformRepository extends ArrayRepository } // The AF_INET6 constant is only defined if ext-sockets is available but IPv6 support might still be available. - if (defined('AF_INET6') || @inet_pton('::') !== false) { + if (defined('AF_INET6') || (function_exists('inet_pton') && Silencer::call('inet_pton', '::') !== false)) { $phpIpv6 = new CompletePackage('ext-network-ipv6', $version, $prettyVersion); - $phpIpv6->setDescription('The network IPv6 PHP extension'); + $phpIpv6->setDescription('PHP IPv6 support'); $this->addPackage($phpIpv6); }