From 95e99952af776cda608ecb431cdd442ae9a54298 Mon Sep 17 00:00:00 2001 From: Malte Bublitz Date: Wed, 24 Jan 2024 18:48:28 +0100 Subject: [PATCH] PS4-Browser und -OS wird wieder korrekt erkannt, inkl. jeweiliger Versionsnummern --- clientinfo.class.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/clientinfo.class.php b/clientinfo.class.php index 5fd4a76..d0324a1 100644 --- a/clientinfo.class.php +++ b/clientinfo.class.php @@ -242,11 +242,11 @@ class ClientInfo { $this->browser = "PlayStation 4 Browser"; $pos_version_start = stripos( $ua, - "PlayStation 4 " - ) + strlen("PlayStation 4 "); + "Version/" + ) + strlen("Version/"); $pos_version_end = stripos( $ua, - ")", + " ", $pos_version_start ); $version = substr( @@ -413,8 +413,23 @@ class ClientInfo { $pos_version_start, $pos_version_end - $pos_version_start ); + } elseif (stripos($ua, "PlayStation 4") !== false) { - $this->OS = "PlayStation 4 System"; + $this->OS = "PlayStation 4 System "; + $pos_version_start = stripos( + $ua, + "PlayStation 4/" + ) + strlen("PlayStation 4/"); + $pos_version_end = stripos( + $ua, + ")", + $pos_version_start + ); + $this->OS .= substr( + $ua, + $pos_version_start, + $pos_version_end - $pos_version_start + ); } elseif (stripos($ua, "FreeBSD") !== false) { $this->OS = "FreeBSD"; -- 2.30.2