Permalink
Browse files

Merge branch 'master' of github.com:hybridauth/hybridauth

  • Loading branch information...
2 parents 972005a + f792cba commit e261094cbb527b2174ca6c1cc00a0ea6a590c79e @StorytellerCZ StorytellerCZ committed Sep 7, 2015
Showing with 8 additions and 2 deletions.
  1. +8 −2 additional-providers/hybridauth-draugiem/Providers/Draugiem.php
@@ -98,7 +98,14 @@ function getUserProfile()
throw new Exception( 'User profile request failed! ' . $this->providerId . ' api returned an invalid response.', 6 );
}
- list($year, $month, $day) =explode("-",@$response['birthday']);
+ $year = $month = $day = null;
+
+ if (isset($response['birthday'])) {
+ $birthday = explode("-", $response['birthday']);
+ if (count($birthday) === 3) {
+ list($year, $month, $day) = $birthday;
+ }
+ }
$this->user->profile->identifier = @ $response['uid'];
$this->user->profile->displayName = $response['name']. ' ' .$response['surname'];
@@ -116,7 +123,6 @@ function getUserProfile()
case 'M': $this->user->profile->gender = 'male'; break;
case 'F': $this->user->profile->gender = 'female'; break;
}
-
return $this->user->profile;
}

0 comments on commit e261094

Please sign in to comment.