Use Fatal function to report bad timezone

This commit is contained in:
baffo32 committed 2015-10-12 15:43:24 -04:00
1 parent 24454253af
commit 4a280a73d1
1 file changed
+6 -7
+6 -7
View File
@@ -46,13 +46,6 @@ if ( false )
ob_end_clean();
}
// Check time zone is set
if (!ini_get('date.timezone')) {
trigger_error( "ZoneMinder is not installed properly: date.timezone in php.ini is unset", E_USER_ERROR );
} else if(!date_default_timezone_set(ini_get('date.timezone'))) {
trigger_error( "ZoneMinder is not installed properly: date.timezone in php.ini is invalid", E_USER_ERROR );
}
require_once( 'includes/config.php' );
require_once( 'includes/logger.php' );
@@ -67,6 +60,12 @@ else
define( "ZM_BASE_PROTOCOL", $protocol );
define( "ZM_BASE_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] );
// Check time zone is set
if (!ini_get('date.timezone') || !date_default_timezone_set(ini_get('date.timezone'))) {
date_default_timezone_set('UTC');
Fatal( "ZoneMinder is not installed properly: date.timezone in php.ini is not set to a valid timezone" );
}
if ( isset($_GET['skin']) )
$skin = $_GET['skin'];
elseif ( isset($_COOKIE['zmSkin']) )