Skip to content

Commit

Permalink
Merge pull request #3 from plesk/deprecated-construction-fix
Browse files Browse the repository at this point in the history
Use type casting for the first parameter of strpos()
  • Loading branch information
sibprogrammer committed Jul 5, 2023
2 parents 8c9cdce + 9ce3cd1 commit ed8590a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,9 @@ CHANGELOG

---

* 1.0.2 (2023-07-05)
* BF: Fix PHP Deprecated Construction warning

* 1.0.1 (2023-06-30)
* BF: Add compatibility with psr/http-message >= 1.0

Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/Server/IoServer.php
Expand Up @@ -93,7 +93,7 @@ public function handleConnect($conn)
$this->decors[spl_object_hash($conn)] = $decor;
$decor->resourceId = (int)$conn->stream;

$uri = $conn->getRemoteAddress();
$uri = (string)$conn->getRemoteAddress();
$decor->remoteAddress = trim(
parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_HOST),
'[]'
Expand Down

0 comments on commit ed8590a

Please sign in to comment.