mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-18 17:35:53 +08:00
Escape reserved SQL keyword when notifying expired credentials.
The CronService fails to send notifications for expired credentials due to the SQL query containing as a column name the word 'rows', which is a reserved keyword. This is the cause of issue #490. This patch fixes the issue simply by quoting the offending keyword. Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
This commit is contained in:
parent
27cbb8271c
commit
4a1878ef0c
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ class CronService {
|
|||
foreach($expired_credentials as $credential){
|
||||
$link = ''; // @TODO create direct link to credential
|
||||
|
||||
$sql = 'SELECT count(*) as rows from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?';
|
||||
$sql = 'SELECT count(*) as `rows` from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?';
|
||||
$id = $credential->getId();
|
||||
$result = $this->db->executeQuery($sql, array($id));
|
||||
$this->logger->debug($credential->getLabel() .' is expired, checking notifications!', array('app' => 'passman'));
|
||||
|
|
Loading…
Add table
Reference in a new issue