From 375688cfa64492766acba8c0d60a02b5e306a954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 22 Apr 2017 17:41:57 +0200 Subject: [PATCH] Work around latest PHP 7.0.18 and 7.1.4 no longer accepting full URIs --- src/TcpConnector.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/TcpConnector.php b/src/TcpConnector.php index e248a45f..def63e50 100644 --- a/src/TcpConnector.php +++ b/src/TcpConnector.php @@ -66,14 +66,12 @@ public function connect($uri) } } - // HHVM fails to parse URIs with a query but no path, so let's add a dummy path - // See also https://3v4l.org/jEhLF - if (defined('HHVM_VERSION') && isset($parts['query']) && !isset($parts['path'])) { - $uri = str_replace('?', '/?', $uri); // @codeCoverageIgnore - } + // latest versions of PHP no longer accept any other URI components and + // HHVM fails to parse URIs with a query but no path, so let's simplify our URI here + $remote = 'tcp://' . $parts['host'] . ':' . $parts['port']; $socket = @stream_socket_client( - $uri, + $remote, $errno, $errstr, 0,