Skip to content

Commit 10aa382

Browse files
authored
Merge pull request #35015 from natoponen/patch-1
Appropriate length check in Notification.php
2 parents 1560c93 + bd7a1e4 commit 10aa382

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/private/Notification/Notification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ public function getDateTime(): \DateTime {
197197
* @since 8.2.0 - 9.0.0: Type of $id changed to string
198198
*/
199199
public function setObject(string $type, string $id): INotification {
200-
if ($type === '' || isset($type[64])) {
200+
if ($type === '' || mb_strlen($type) > 64) {
201201
throw new \InvalidArgumentException('The given object type is invalid');
202202
}
203203
$this->objectType = $type;
204204

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

0 commit comments

Comments
 (0)