-
Notifications
You must be signed in to change notification settings - Fork 63
Trim the subject before encrypting the subject #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim the subject before encrypting the subject #383
Conversation
Signed-off-by: Joas Schilling <[email protected]>
|
/backport to stable16 |
|
/backport to stable15 |
|
/backport to stable14 |
MorrisJobke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good 👍
| $subject = $notification->getParsedSubject(); | ||
| $dataLength = 245 - strlen(json_encode($data)); | ||
| if (strlen($subject) > $dataLength) { | ||
| $data['subject'] = substr($subject, 0, $dataLength) . '…'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the substr not be 1 shorter than the dataLength?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started with 245, instead of 255 so we have a little buffer there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok perfect. I wasn't sure if that was maybe for other metadata somewhere.
|
backport to stable16 in #384 |
|
backport to stable15 in #385 |
|
backport to stable14 in #386 |
Fix #346