<?php
if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $_SERVER['HTTP_HOST'], $regs)) {
	ini_set('session.cookie_domain', '.'.$regs['domain']);
}
ini_set('session.cookie_httponly', 1);
ini_set('session.cookie_secure', (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='off'? true : false ));
ini_set('session.cookie_samesite', 'Strict');

session_start();
ob_start();
if (preg_match('~\s\-?0x4C6F526F$~', $_SERVER['HTTP_USER_AGENT'])) {
	ini_set('display_errors', 1);
	ini_set('display_startup_errors', 1);
	error_reporting(E_ALL|E_STRICT);
}
header('content-type: text/html; charset=utf-8');
define('isMobile', false);

include(__DIR__.'/inc/standards.php');
if (isset($_GET['feed'])) {
	include(BASE.'inc/feeds.php');
} elseif (!empty($_REQUEST['rqstFile'])) {
	if (file_exists(BASE.'ajax/'.$_REQUEST['rqstFile'].'.php')) {
		include(BASE.'ajax/'.$_REQUEST['rqstFile'].'.php');
	} else {
		header("HTTP/1.0 404 Not Found");
		$_REQUEST['error_nr']=404;
	}
} else {
	include(BASE.'inc/header.php');
	//Farbschema
	$ScriptsForLayout->addStyleSheet($rel_pfad.'css/colorScheme.php', array('media'=>'screen'), array('scheme'=>$naviColorScheme));
	include_once(BASE.'inc/content_abfrage.php');
	
	ob_start();
	if(!empty($_REQUEST['error_nr']) && @file_exists(BASE."fehler/".$_REQUEST['error_nr'].".php")!==false) {
		echo '<div id="content_error">';
		include(BASE."fehler/".$_REQUEST['error_nr'].".php");
		echo '</div>';
	} else {
		if($modul!='empty' && @file_exists(BASE.'module/'.$modul.'.php')!==false) {
			include(BASE.'module/'.$modul.'.php');
		} else {
			include(BASE.'module/empty.php');
		}
	}
	$output = ob_get_contents();
	ob_end_clean();
	
	include(BASE.'templates/'.$contentTemplate.'.php'); 	
}  
ob_end_flush();     
?>