fix: [authkey:add] Make sure to default to expiration=0 if not provided

perm_community_admin
Sami Mokaddem 2024-05-23 15:46:43 +02:00
parent d617c579a9
commit 761e5e9388
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class AuthKeysTable extends AppTable
public function beforeMarshal(EventInterface $event, ArrayObject $data, ArrayObject $options)
{
$data['created'] = time();
if (!isset($data['expiration'])) {
if (!isset($data['expiration']) || empty($data['expiration'])) {
$data['expiration'] = 0;
} else {
$data['expiration'] = strtotime($data['expiration']);