Skip to content

Commit

Permalink
Merge pull request #35113 from nextcloud/backport/35015/stable24
Browse files Browse the repository at this point in the history
[stable24] Appropriate length check in Notification.php
  • Loading branch information
szaimen authored Nov 13, 2022
2 parents b4b206c + d4f9b82 commit 80040cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Notification/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ public function getDateTime(): \DateTime {
* @since 8.2.0 - 9.0.0: Type of $id changed to string
*/
public function setObject(string $type, string $id): INotification {
if ($type === '' || isset($type[64])) {
if ($type === '' || mb_strlen($type) > 64) {
throw new \InvalidArgumentException('The given object type is invalid');
}
$this->objectType = $type;

if ($id === '' || isset($id[64])) {
if ($id === '' || mb_strlen($id) > 64) {
throw new \InvalidArgumentException('The given object id is invalid');
}
$this->objectId = $id;
Expand Down

0 comments on commit 80040cb

Please sign in to comment.