Fixed syslog pruning when dbFetchRow() returns array (#10850)

If dbFetchRow() returns an array, dbDelete() won't do its work pruning the syslog table and we'll drop out of the block via break.  This if statement will take the value return inside the array and replace $limit with that value.  This way, dbDelete() can successfully prune the syslog table.

dbFetchCell() can return an array that won't work when fed to dbDelete().  This keeps that from occurring so the syslog table can be pruned.
This commit is contained in:
rj-taylor
2019-11-19 20:25:11 +01:00
committed by PipoCanaja
parent 6c27eba4fa
commit a28a17d963
+1 -1
View File
@@ -71,7 +71,7 @@ if ($options['f'] === 'syslog') {
if (is_numeric($syslog_purge)) {
$rows = (int)dbFetchCell('SELECT MIN(seq) FROM syslog');
while (true) {
$limit = dbFetchRow('SELECT seq FROM syslog WHERE seq >= ? ORDER BY seq LIMIT 1000,1', array($rows));
$limit = dbFetchCell('SELECT seq FROM syslog WHERE seq >= ? ORDER BY seq LIMIT 1000,1', array($rows));
if (empty($limit)) {
break;
}