Skip to content

Commit 6dab6be

Browse files
authored
Merge pull request #2665 from mecab/fix-sql
Fix SQL in cleaning up old notifications
2 parents 2dfe175 + be1b57a commit 6dab6be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/classes/notification.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function sendNotification($account_id, $strType, $aMailData) {
190190
public function cleanupNotifications($days=7) {
191191
$failed = 0;
192192
$this->deleted = 0;
193-
$stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE time < (NOW() - ? * 24 * 60 * 60)");
193+
$stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE time < (NOW() - INTERVAL ? DAY)");
194194
if (! ($this->checkStmt($stmt) && $stmt->bind_param('i', $days) && $stmt->execute())) {
195195
$failed++;
196196
} else {

0 commit comments

Comments
 (0)