Project

General

Profile

« Previous | Next » 

Revision caed0783

Added by Stilez y about 9 years ago

Use global backup count instead of hardcoded value and remove redundant function
(cherry picked from commit 01b5410ae8391998ba560d40f447c7f556472c5b)

View differences:

src/etc/inc/config.lib.inc
792 792
	global $g;
793 793
	$i = false;
794 794

  
795
	$revisions = get_config_backup_count();
795
	$revisions = intval(is_numericint($config['system']['backupcount']) ? $config['system']['backupcount'] : $g['default_config_backup_count']);
796 796

  
797 797
	if (!$lock) {
798 798
		$lockkey = lock('config');
......
997 997
	return $revision;
998 998
}
999 999

  
1000
function get_config_backup_count() {
1001
	global $config, $g;
1002
	if (isset($config['system']['backupcount']) && is_numeric($config['system']['backupcount']) && ($config['system']['backupcount'] >= 0)) {
1003
		return intval($config['system']['backupcount']);
1004
	} elseif ($g['platform'] == "nanobsd") {
1005
		return 5;
1006
	} else {
1007
		return 30;
1008
	}
1009
}
1010

  
1011 1000
function pfSense_clear_globals() {
1012 1001
	global $config, $FilterIfList, $GatewaysList, $filterdns, $aliases, $aliastable;
1013 1002

  

Also available in: Unified diff