diff --git a/include/check.php b/include/check.php index 62e6582..e831f49 100644 --- a/include/check.php +++ b/include/check.php @@ -96,8 +96,11 @@ $this->data_profile = $this->Parser->WEBParsing('https://osu.ppy.sh/u/' . $osuid); $this->OsuID = $this->Parser->splits($this->data_profile, 'var userId = ', ';'); $this->RealID = $this->Parser->splits($this->data_profile, '', '\'s profile'); - if(empty($this->OsuID)) + if(empty($this->OsuID) || empty($this->RealID)) + { + $this->ResetObject(); return false; + } $this->Occupation = $this->Parser->splits($this->data_profile, '
', '
'); diff --git a/test.php b/test.php index fab941f..78c9cc6 100644 --- a/test.php +++ b/test.php @@ -5,6 +5,11 @@ function GetDataTest() { global $Check; + if(empty($Check->RealID) || empty($Check->OsuID)) + { + echo '
User not found

'; + return false; + } echo $Check->RealID . ' (' . $Check->OsuID . ')'; if ($Check->Occupation_Set === $Check->Occupation) @@ -28,6 +33,9 @@ $Check->CheckUser('angelsIm', 0); GetDataTest(); + $Check->CheckUser('didisksks', 0); + GetDataTest(); + $Check->CheckUser('peppy', 0); GetDataTest();