From 1424cc7664f8689297e521c7259741ee5e70573f Mon Sep 17 00:00:00 2001 From: atymic Date: Fri, 29 Jan 2021 18:18:58 +1100 Subject: [PATCH] fix: steam provider offset error (#621) --- Provider.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Provider.php b/Provider.php index 7f43f69..fbde202 100644 --- a/Provider.php +++ b/Provider.php @@ -180,9 +180,13 @@ public function validate() $results = $this->parseResults($response->getBody()->getContents()); - $this->parseSteamID(); + $isValid = $results['is_valid'] === 'true'; - return $results['is_valid'] === 'true'; + if ($isValid) { + $this->parseSteamID(); + } + + return $isValid; } /** @@ -279,7 +283,7 @@ public function parseSteamID() $matches ); - $this->steamId = is_numeric($matches[1]) ? $matches[1] : 0; + $this->steamId = isset($matches[1]) && is_numeric($matches[1]) ? $matches[1] : 0; } /**