Merge pull request #35015 from natoponen/patch-1

Appropriate length check in Notification.php
This commit is contained in:
Simon L 2022-11-11 17:08:21 +01:00 committed by GitHub
commit 10aa3827f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,12 +197,12 @@ class Notification implements INotification {
* @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;