<commit_before><?php

namespace Saft;


Class Fruit extends \Exception {

	public function squeeze(){
		$msg = $this->getMessage();
		$code = $this->getCode();
		switch ($code){
			case 301:
			case 307:
				header('HTTP/1.1 ' . Elf::$status[$code]);
				exit(header('location: ' . $msg));
			case 404:
				if (empty($msg) === true)
					$msg = 'The requested URL <code>' . $_SERVER['REQUEST_URI'] . '</code> was not found on this server. You may go back to <a href=' . App::$absolute . '>main page</a>.';
				break;
			case 500:
				if (empty($msg) === true)
					$msg = 'The server encountered an internal error or misconfiguration and was unable to complete the request.';
				break;
			case 503:
				if (empty($msg) === true)
					$msg = 'The requested URL <code>' . $_SERVER['REQUEST_URI'] . '</code> cannot be accessed temporarily on this server. Please try again later.';
				break;
			default:
				if (empty($msg) === true)
					$msg = 'Don&rsquo;t spiel!';
				break;
		}

		# allow only white-listed IP addresses to view details
		if (	App::DEBUG_MODE === 1
			&&	preg_match('{
			^
			(?:' . str_replace(array('.', ':'), array('\.', '\:'), App::DEBUG_IP) . ')
			$
			}x', $_SERVER['REMOTE_ADDR']) === 1
		)
			$msg.= '
	<p><a class=trace href="javascript:void(toggle(\'trace\'))"><span>▸</span> Stacktrace (<span>click</span>)</a>
	<pre id=trace>' . $this->getTraceAsString() . "\n   thrown in <b>" . $this->getFile() . '</b> on line <b>' . $this->getLine() . "</b>\n   <small>" . substr(Elf::getSqueezedStr(), 5, -4) . '</small></pre>';

		else if ($code === 500){
			$pre = '<br>
		<pre id=info>Get detailed information about what is exactly wrong by <b>adding your
IP address to the list of allowed remote addresses</b> inside <i>app.php</i>.
<small>You may use <a href=http://doogvaard.net/speelplaats/2011/07/19/ip/>IP</a> to cut and paste your current IP address.</small></pre>';

			if (strpos($msg, 'Aut') === 0)<commit_msg>Small flaw fixed<commit_after><?php

namespace Saft;


Class Fruit extends \Exception {

	public function squeeze(){
		$msg = $this->getMessage();
		$code = $this->getCode();
		switch ($code){
			case 301:
			case 307:
				header('HTTP/1.1 ' . Elf::$status[$code]);
				exit(header('location: ' . $msg));
			case 404:
				if (empty($msg) === true)
					$msg = 'The requested URL <code>' . $_SERVER['REQUEST_URI'] . '</code> was not found on this server. You may go back to <a href=' . App::$absolute . '>main page</a>.';
				break;
			case 500:
				if (empty($msg) === true)
					$msg = 'The server encountered an internal error or misconfiguration and was unable to complete the request.';
				break;
			case 503:
				if (empty($msg) === true)
					$msg = 'The requested URL <code>' . $_SERVER['REQUEST_URI'] . '</code> cannot be accessed temporarily on this server. Please try again later.';
				break;
			default:
				if (empty($msg) === true)
					$msg = 'Don&rsquo;t spiel!';
				break;
		}

		# allow only white-listed IP addresses to view details
		if (	App::DEBUG_MODE === 1
			&&	preg_match('{
			^
			(?:' . str_replace(array('.', ':'), array('\.', '\:'), App::DEBUG_IP) . ')
			$
			}x', $_SERVER['REMOTE_ADDR']) === 1
		)
			$msg.= '
	<p><a class=trace href="javascript:void(toggle(\'trace\'))"><span>▸</span> Stacktrace (<span>click</span>)</a>
	<pre id=trace>' . $this->getTraceAsString() . "\n   thrown in <b>" . $this->getFile() . '</b> on line <b>' . $this->getLine() . "</b>\n   <small>" . substr(Elf::getSqueezedStr(), 5, -4) . '</small></pre>';

		else if ($code === 500){
			$pre = "<br>
	<pre id=info>Get detailed information about what is exactly\nwrong by adding your IP address <b>" . $_SERVER['REMOTE_ADDR'] . "</b> to\nthe list of allowed remote addresses inside <i>app.php</i>.</pre>";

			if (strpos($msg, 'Aut') === 0)
{'fraction_non_alphanumeric': 0.20595991561181434, 'fraction_numerical': 0.01529535864978903, 'mean_word_length': 3.3299086757990866, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 73, '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': '6236326', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1284, 'n_words': 383}