Fixed $bb_cfg['pm_days_keep'] (#834)

This commit is contained in:
Roman Kelesidis 2023-07-20 23:08:45 +07:00 committed by GitHub
commit fbf5bf94f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,19 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2023 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
$pm_days_keep = (int)$bb_cfg['pm_days_keep'];
DB()->query("
DELETE FROM " . BB_PRIVMSGS . "
WHERE privmsgs_date < " . (TIMENOW - 86400 * $pm_days_keep) . "
");