Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix casting token to int
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jun 18, 2021
commit 0eb014139945b3c8dbedccebb64615f5ca124cdc
2 changes: 2 additions & 0 deletions lib/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf
$maxAge = time() - 60 * 24 * 60 * 60;

foreach ($devices as $device) {
$device['token'] = (int) $device['token'];
$this->printInfo('');
$this->printInfo('Device token:' . $device['token']);

Expand Down Expand Up @@ -262,6 +263,7 @@ public function pushDeleteToDevice(string $userId, int $notificationId, string $

$userKey = $this->keyManager->getKey($user);
foreach ($devices as $device) {
$device['token'] = (int) $device['token'];
if (!$this->validateToken($device['token'], $maxAge)) {
// Token does not exist anymore
continue;
Expand Down