<commit_before><?php

	define('DOCROOT', rtrim(dirname(__FILE__), '\\/'));
	define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'));

	require(DOCROOT . '/symphony/lib/boot/bundle.php');
	
	function renderer($mode='frontend'){
		require_once(CORE . "/class.{$mode}.php");
		return ($mode == 'administration' ? Administration::instance() : Frontend::instance());
	}
	
	$renderer = (isset($_GET['mode']) ? strtolower($_GET['mode']) : 'frontend');
	$output = renderer($renderer)->display(getCurrentPage());
	
	header(sprintf('Content-Length: %d', strlen($output)));
	echo $output;

	exit();<commit_msg>Closed security hole that could have allowed a file inclusion attack to occur.<commit_after><?php

	define('DOCROOT', rtrim(dirname(__FILE__), '\\/'));
	define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'));

	require(DOCROOT . '/symphony/lib/boot/bundle.php');
	
	function renderer($mode='frontend'){
		if(!in_array($mode, array('frontend', 'administration'))){
			throw new Exception('Invalid Symphony Renderer mode specified. Must be either "frontend" or "administration".');
		}
		require_once(CORE . "/class.{$mode}.php");
		return ($mode == 'administration' ? Administration::instance() : Frontend::instance());
	}
	
	$renderer = (isset($_GET['mode']) && strtolower($_GET['mode']) == 'administration' 
			? 'administration' 
			: 'frontend');

	$output = renderer($renderer)->display(getCurrentPage());
	
	header(sprintf('Content-Length: %d', strlen($output)));
	echo $output;

	exit();
{'fraction_non_alphanumeric': 0.2239089184060721, 'fraction_numerical': 0.0, 'mean_word_length': 5.969162995594714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5024443', 'n_tokens_mistral': 527, 'n_tokens_neox': 498, 'n_words': 87}