Fix alert log clearing SQL query (#14200)

only replace one, lock_and_purge_query() already takes care of second...
This commit is contained in:
Jellyfrog
2022-08-14 16:12:46 +02:00
committed by GitHub
parent 4a7fea94d9
commit d3d2aa92e1

View File

@@ -287,7 +287,7 @@ if ($options['f'] === 'alert_log') {
if (! (is_numeric($purge_duration) && $purge_duration > 0)) {
return -2;
}
$sql = str_replace('?', strval($purge_duration), $sql);
$sql = preg_replace('/\?/', strval($purge_duration), $sql, 1);
lock_and_purge_query($table, $sql, $msg);
}