<commit_before><?php // we only get here by having $_SESSION['case'] set
$message = '';
$caseInfo = array();
require 'proxy.php';
$ch = curl_init();
$result = tribGetCase($_SESSION['case'], $_SESSION['realm'], $ch, $_SESSION['cookies']);
if ($result)
{
	$_SESSION['cookies'] = $result['cookies'];
	require 'parsing.php';
	$caseInfo = tribParseHTML($result['html']);

	$message = 'You have ' . $caseInfo['numGames'] . ' games to review and your form tokens are ';
	$message .= htmlspecialchars(json_encode($caseInfo['formTokens']));
	$message .= '<br />';

	$result = tribGetGame($_SESSION['case'], 1, $_SESSION['realm'], $ch, $_SESSION['cookies']);
	if ($result)
	{
		$_SESSION['cookies'] = $result['cookies'];
		//Parse game info here.
		$message .= "<br />Game JSON is: " . $result["JSON"] . "<br />";
	}
	else
		$message .= 'Failed to get Game 1<br />';

	$result = tribGetCaptcha($_SESSION['realm'], $ch, $_SESSION['cookies']);
	if ($result)
	{
		$_SESSION['cookies'] = $result['cookies'];
		$message .= 'Captcha: <img src="{$result["captcha"]}">';
		$message .= "<br />";
	}
	else
		$message .= 'Failed to get captcha<br />';
}
else
{
	$message = 'Failed to get case info';
}
curl_close($ch);
?>
<!DOCTYPE html>
<html>
<head>
	<?= htmlHead(); ?>
</head>
<body>
	<h1>Reviewing case #<?= $_SESSION['case'] ?></h1>
	<p><?= $message ?></p>
	<p>Rather than display this info, we will just load the first game and display that info here.</p>
</body>
</html>
<commit_msg>Bug fix<commit_after><?php // we only get here by having $_SESSION['case'] set
$message = '';
$caseInfo = array();
require 'proxy.php';
$ch = curl_init();
$result = tribGetCase($_SESSION['case'], $_SESSION['realm'], $ch, $_SESSION['cookies']);
if ($result)
{
	$_SESSION['cookies'] = $result['cookies'];
	require 'parsing.php';
	$caseInfo = tribParseHTML($result['html']);

	$message = 'You have ' . $caseInfo['numGames'] . ' games to review and your form tokens are ';
	$message .= htmlspecialchars(json_encode($caseInfo['formTokens']));
	$message .= '<br />';

	$result = tribGetGame($_SESSION['case'], 1, $_SESSION['realm'], $ch, $_SESSION['cookies']);
	if ($result)
	{
		$_SESSION['cookies'] = $result['cookies'];
		//Parse game info here.
		$message .= "<br />Game JSON is: " . $result["JSON"] . "<br />";
	}
	else
		$message .= 'Failed to get Game 1<br />';

	$result = tribGetCaptcha($_SESSION['realm'], $ch, $_SESSION['cookies']);
	if ($result)
	{
		$_SESSION['cookies'] = $result['cookies'];
		$message .= "Captcha: <img src=\"{$result["captcha"]}\">";
		$message .= "<br />";
	}
	else
		$message .= 'Failed to get captcha<br />';
}
else
{
	$message = 'Failed to get case info';
}
curl_close($ch);
?>
<!DOCTYPE html>
<html>
<head>
	<?= htmlHead(); ?>
</head>
<body>
	<h1>Reviewing case #<?= $_SESSION['case'] ?></h1>
	<p><?= $message ?></p>
	<p>Rather than display this info, we will just load the first game and display that info here.</p>
</body>
</html>

{'fraction_non_alphanumeric': 0.23449216087252897, 'fraction_numerical': 0.0027266530334014998, 'mean_word_length': 4.800395256916996, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, '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': '6380101', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1035, 'n_words': 269}