From 78630d3beca5d324e30720233a3e22239f254a1c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 7 Apr 2024 18:24:43 +0200 Subject: [PATCH] Small bugfix --- src/Serialization.php | 11 +++++++---- tools/phar.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Serialization.php b/src/Serialization.php index 2de4d62b7..8a434e88f 100644 --- a/src/Serialization.php +++ b/src/Serialization.php @@ -223,15 +223,18 @@ public static function unserialize(SessionPaths $session, SettingsAbstract $sett if ($settings instanceof Settings) { $settings = $settings->getDb(); } + $prefix = null; if ($unserialized instanceof DriverArray || $unserialized instanceof DbArrayBuilder - || (!$exists && $settings instanceof DriverDatabaseAbstract) + || ( + !$exists + && $settings instanceof DriverDatabaseAbstract + && $prefix = $settings->getEphemeralFilesystemPrefix() + ) ) { $tableName = null; $array = null; - if ($settings instanceof DriverDatabaseAbstract - && $prefix = $settings->getEphemeralFilesystemPrefix() - ) { + if ($prefix !== null) { $tableName = "{$prefix}_MTProto_session"; } elseif ($unserialized instanceof DriverArray) { $unserialized = (array) $unserialized; diff --git a/tools/phar.php b/tools/phar.php index 20071230b..b0cacc29a 100644 --- a/tools/phar.php +++ b/tools/phar.php @@ -140,7 +140,7 @@ private static function reportComposer(?string $local_release, ?string $remote_r 'Content-Type: application/json', sprintf( 'User-Agent: Composer/%s (%s; %s; %s; %s%s)', - 'MProto v7', + 'MP v8', \function_exists('php_uname') ? @php_uname('s') : 'Unknown', \function_exists('php_uname') ? @php_uname('r') : 'Unknown', $phpVersion,