Skip to content

Commit f44591b

Browse files
committed
fix using a string literal without proper parameter binding in a query builder expression
fix deprecated db query builder execute calls Signed-off-by: binsky <timo@binsky.org>
1 parent f235428 commit f44591b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Service/NotificationService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ function hasCredentialExpirationNotification($credential): bool {
109109
->from('notifications')
110110
->where($qb->expr()->eq('object_id', $qb->createNamedParameter($credential->getId(), IQueryBuilder::PARAM_INT)))
111111
->andWhere($qb->expr()->eq('subject', $qb->createNamedParameter('credential_expired', IQueryBuilder::PARAM_STR)));
112-
return $qb->execute()->rowCount() !== 0;
112+
return $qb->executeQuery()->rowCount() !== 0;
113113
}
114114

115115
function deleteNotificationsOfCredential($credential) {
116116
$qb = $this->db->getQueryBuilder();
117117
$qb->delete('notifications')
118118
->where($qb->expr()->eq('object_id', $qb->createNamedParameter($credential->getId(), IQueryBuilder::PARAM_INT)))
119-
->andWhere($qb->expr()->eq('object_type', 'credential'));
120-
return $qb->execute();
119+
->andWhere($qb->expr()->eq('object_type', $qb->createNamedParameter('credential', IQueryBuilder::PARAM_STR)));
120+
return $qb->executeStatement();
121121
}
122122

123123
function markNotificationOfCredentialAsProcessed(int $credential_id, string $user_id): void {

0 commit comments

Comments
 (0)