Skip to content

Commit

Permalink
Fix empty UUID upon registration
Browse files Browse the repository at this point in the history
Fix issue where UUID would return empty during registration
  • Loading branch information
samerton committed Jan 9, 2016
1 parent 2a01708 commit 45c9b69
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pages/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@

// Perform validation on Minecraft name
$profile = ProfileUtils::getProfile(str_replace(' ', '%20', $mcname));
$result = $profile->getProfileAsArray();
$mcname_result = $profile->getProfileAsArray();

if(isset($result['username']) && !empty($result['username'])){
if(isset($mcname_result['username']) && !empty($mcname_result['username'])){
// Valid
} else {
// Invalid
Expand All @@ -131,9 +131,9 @@

// Perform validation on Minecraft name
$profile = ProfileUtils::getProfile(str_replace(' ', '%20', $mcname));
$result = $profile->getProfileAsArray();
$mcname_result = $profile->getProfileAsArray();

if(isset($result['username']) && !empty($result['username'])){
if(isset($mcname_result['username']) && !empty($mcname_result['username'])){
// Valid
} else {
// Invalid
Expand Down Expand Up @@ -174,10 +174,12 @@

if($validation->passed()){
if($uuid_linking == '1'){
$profile = ProfileUtils::getProfile($mcname);
$result = $profile->getProfileAsArray();
if(isset($result["uuid"]) && !empty($result['uuid'])){
$uuid = $result['uuid'];
if(!isset($mcname_result)){
$profile = ProfileUtils::getProfile(str_replace(' ', '%20', $mcname));
$mcname_result = $profile->getProfileAsArray();
}
if(isset($mcname_result["uuid"]) && !empty($mcname_result['uuid'])){
$uuid = $mcname_result['uuid'];
} else {
$uuid = '';
}
Expand Down

0 comments on commit 45c9b69

Please sign in to comment.