Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
localzet committed Dec 2, 2024
1 parent e39241b commit 788787b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,17 @@ public static function onMessage(ConnectionInterface &$connection, mixed $reques
}

try {
$data = unserialize($request);
self::$connection->json = false;
$data = json_decode($request, true);
self::$connection->json = true;
} catch (Throwable $exception) {
self::$debug && LocalzetServer::log('Throwable: ' . $exception);
// self::$debug && LocalzetServer::log('Throwable: ' . $exception);
$data = false;
}

if (!$data) {
try {
$data = json_decode($request, true);
self::$connection->json = true;
$data = unserialize($request);
self::$connection->json = false;
} catch (Throwable $exception) {
self::$debug && LocalzetServer::log('Throwable: ' . $exception);
return;
Expand Down
10 changes: 5 additions & 5 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ public function onMessage(ConnectionInterface &$connection, mixed $request): voi
}

try {
$data = unserialize($request);
$connection->json = false;
$data = json_decode($request, true);
$connection->json = true;
} catch (Throwable $exception) {
$this->debug && LocalzetServer::log('Throwable: ' . $exception);
// $this->debug && LocalzetServer::log('Throwable: ' . $exception);
$data = false;
}

if (!$data) {
try {
$data = json_decode($request, true);
$connection->json = true;
$data = unserialize($request);
$connection->json = false;
} catch (Throwable $exception) {
$this->debug && LocalzetServer::log('Throwable: ' . $exception);
return;
Expand Down

0 comments on commit 788787b

Please sign in to comment.