Skip to content
This repository was archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
Fixed dynamic properties handling
Browse files Browse the repository at this point in the history
Fixed a bug that prevents using dynamic properties like ORM results to be used by castObjectToRegistration.
  • Loading branch information
bistory authored Mar 24, 2019
1 parent 571c8e5 commit e283dd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/u2flib_server/U2F.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,16 @@ public function doAuthenticate(array $requests, array $registrations, $response)
protected static function castObjectToRegistration($object)
{
$reg = new Registration();
if (property_exists($object, 'publicKey')) {
if (isset($object->publicKey)) {
$reg->publicKey = $object->publicKey;
}
if (property_exists($object, 'certificate')) {
if (isset($object->certificate)) {
$reg->certificate = $object->certificate;
}
if (property_exists($object, 'counter')) {
if (isset($object->counter)) {
$reg->counter = $object->counter;
}
if (property_exists($object, 'keyHandle')) {
if (isset($object->keyHandle)) {
$reg->keyHandle = $object->keyHandle;
}
return $reg;
Expand Down

0 comments on commit e283dd0

Please sign in to comment.