Merge pull request #2665 from mecab/fix-sql

Fix SQL in cleaning up old notifications
This commit is contained in:
Sebastian Grewe 2018-02-01 09:50:17 +01:00 committed by GitHub
commit 6dab6be177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,7 +190,7 @@ class Notification extends Mail {
public function cleanupNotifications($days=7) {
$failed = 0;
$this->deleted = 0;
$stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE time < (NOW() - ? * 24 * 60 * 60)");
$stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE time < (NOW() - INTERVAL ? DAY)");
if (! ($this->checkStmt($stmt) && $stmt->bind_param('i', $days) && $stmt->execute())) {
$failed++;
} else {