From 33a77a858b3d7b21f43389074389289cce4be3cf Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 12 Jan 2024 19:34:06 +0200 Subject: [PATCH] add strict datatype validation --- src/Xash3D/Master.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Xash3D/Master.php b/src/Xash3D/Master.php index 5c7c58e..7feadbb 100644 --- a/src/Xash3D/Master.php +++ b/src/Xash3D/Master.php @@ -49,7 +49,7 @@ class Master ): ?array { // Is connected - if (!is_resource($this->_socket)) + if (false === is_resource($this->_socket)) { $this->_errors[] = _('Socket connection error'); @@ -57,7 +57,7 @@ class Master } // Filter query - if (!fwrite($this->_socket, "1{$region}{$host}:{$port}\0\gamedir\t{$gamedir}\0")) + if (false === fwrite($this->_socket, "1{$region}{$host}:{$port}\0\gamedir\t{$gamedir}\0")) { fclose( $this->_socket @@ -69,7 +69,7 @@ class Master } // Skip header - if (!fread($this->_socket, 6)) + if (false === fread($this->_socket, 6)) { fclose( $this->_socket