Project

General

Profile

« Previous | Next » 

Revision fc3bec29

Added by Renato Botelho over 9 years ago

Make sure timezones listed on first level directory is also grabbed by system_get_timezone_list(). It fixes #5303

View differences:

src/etc/inc/system.inc
1501 1501
function system_get_timezone_list() {
1502 1502
	global $g;
1503 1503

  
1504
	$file_list = glob("/usr/share/zoneinfo/*/*");
1504
	$file_list = array_merge(
1505
		glob("/usr/share/zoneinfo/[A-Z]*"),
1506
		glob("/usr/share/zoneinfo/*/*")
1507
	);
1505 1508

  
1506 1509
	if (empty($file_list)) {
1507 1510
		$file_list[] = $g['default_timezone'];
1511
	} else {
1512
		/* Remove directories from list */
1513
		$file_list = array_filter($file_list, function($v) {
1514
			return !is_dir($v);
1515
		});
1508 1516
	}
1509 1517

  
1510
	return str_replace('/usr/share/zoneinfo/', '', $file_list);
1518
	/* Remove directory prefix */
1519
	$file_list = str_replace('/usr/share/zoneinfo/', '', $file_list);
1520

  
1521
	sort($file_list);
1522

  
1523
	return $file_list;
1511 1524
}
1512 1525

  
1513 1526
function system_timezone_configure() {

Also available in: Unified diff