<?php
/**
 * Server config file
 * 
 * This file set all server / PHP options
 * 
 * @package linea21\core\config_files
 * @author $Author$ - linea21 <info@linea21.com>
 * @version $Id$ 
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

ini_set("arg_separator.output", "&amp;");
ini_set('register_globals', 0);

if(defined('MOD_DEBUG') && MOD_DEBUG == true) {
	error_reporting(E_ALL | E_STRICT);
  ini_set('display_errors', 1);
  ini_set('display_startup_errors',1);
  ini_set("track_errors", 1);
} else {
  ini_set('display_errors', 0);
  ini_set('display_startup_errors',0);
}
setlocale(LC_NUMERIC, 'en_US');
setlocale(LC_TIME, 'fr_FR.UTF-8');
ini_set('session.auto_start', 0);
if(defined('INACTIVITY_MAX_TIME')) {
  ini_set('session.cookie_lifetime', 0);
  ini_set('session.gc_maxlifetime', INACTIVITY_MAX_TIME);
}
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', 1);
if(extension_loaded('zlib')) ini_set('zlib.output_compression', 1);

if(is_https()) ini_set('session.cookie_secure', 1); // only if site use HTTPS
if(session_id() == '') {
	ini_set('session.use_trans_sid', 0);
}
date_default_timezone_set(TIME_ZONE);
ini_set('url_rewriter.tags','');

// check either safari or chrome is used
// fix chrom absurd bug : http://dev.linea21.com/issues/693
if(isset($_SERVER['HTTP_USER_AGENT'])) { // check if $_SERVER['HTTP_USER_AGENT'] exists to prevent bug when use with cron call
    if ((stripos( $_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false) || (stripos( $_SERVER['HTTP_USER_AGENT'], 'Safari') !== false)) header('X-XSS-Protection: 1');
}
?>