From 3d256eb10a81be7c67634b9a677c8ae8d230c5dc Mon Sep 17 00:00:00 2001 From: stilez Date: Tue, 24 May 2016 10:25:11 +0100 Subject: Use global backup count instead of hardcoded value and remove redundant function (cherry picked from commit 01b5410ae8391998ba560d40f447c7f556472c5b) --- src/etc/inc/config.lib.inc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc index 4285d3d..0a2c921 100644 --- a/src/etc/inc/config.lib.inc +++ b/src/etc/inc/config.lib.inc @@ -792,7 +792,7 @@ function cleanup_backupcache($lock = false) { global $g; $i = false; - $revisions = get_config_backup_count(); + $revisions = intval(is_numericint($config['system']['backupcount']) ? $config['system']['backupcount'] : $g['default_config_backup_count']); if (!$lock) { $lockkey = lock('config'); @@ -997,17 +997,6 @@ function make_config_revision_entry($desc = null, $override_user = null) { return $revision; } -function get_config_backup_count() { - global $config, $g; - if (isset($config['system']['backupcount']) && is_numeric($config['system']['backupcount']) && ($config['system']['backupcount'] >= 0)) { - return intval($config['system']['backupcount']); - } elseif ($g['platform'] == "nanobsd") { - return 5; - } else { - return 30; - } -} - function pfSense_clear_globals() { global $config, $FilterIfList, $GatewaysList, $filterdns, $aliases, $aliastable; -- cgit v1.1