Skip to content

Commit

Permalink
More buffer to the key size
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jun 25, 2020
1 parent b6a4db6 commit 7187a13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ protected function encryptAndSign(Key $userKey, array $device, int $id, INotific

// Max length of encryption is 255, so we need to make sure the subject is shorter.
// We also substract a buffer of 10 bytes.
$maxDataLength = 255 - strlen(json_encode($data)) - 10;
$maxDataLength = 200 - strlen(json_encode($data));
$data['subject'] = $this->shortenJsonEncodedMultibyte($notification->getParsedSubject(), $maxDataLength);
if ($notification->getParsedSubject() !== $data['subject']) {
$data['subject'] .= '';
Expand Down

0 comments on commit 7187a13

Please sign in to comment.