<commit_before><?php

/**
 * Check the credentials that the user got from the A-Select server.
 * This function is called after the user returns from the A-Select server.
 *
 * @author <NAME>, Tilburg University
 */
function check_credentials() {
	
	if (!array_key_exists('ssp_state', $_REQUEST))
		SimpleSAML_Auth_State::throwException($state, new SimpleSAML_Error_Exception("Missing ssp_state parameter"));	
	$id = $_REQUEST['ssp_state'];

	// sanitize the input
	$sid = SimpleSAML_Utilities::parseStateID($id);
	if (!is_null($sid['url'])) {
		SimpleSAML_Utilities::checkURLAllowed($sid['url']);
	}

	$state = SimpleSAML_Auth_State::loadState($id, 'aselect:login');<commit_msg>aselect: bugfix (do not try to throw a state-aware exception when no state is available!).<commit_after><?php

/**
 * Check the credentials that the user got from the A-Select server.
 * This function is called after the user returns from the A-Select server.
 *
 * @author <NAME>, Tilburg University
 */
function check_credentials() {
	
	if (!array_key_exists('ssp_state', $_REQUEST))
		throw new SimpleSAML_Error_Exception("Missing ssp_state parameter");
	$id = $_REQUEST['ssp_state'];

	// sanitize the input
	$sid = SimpleSAML_Utilities::parseStateID($id);
	if (!is_null($sid['url'])) {
		SimpleSAML_Utilities::checkURLAllowed($sid['url']);
	}

	$state = SimpleSAML_Auth_State::loadState($id, 'aselect:login');
{'fraction_non_alphanumeric': 0.13926776740847094, 'fraction_numerical': 0.0, 'mean_word_length': 5.900990099009901, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1539911', 'n_tokens_mistral': 453, 'n_tokens_neox': 438, 'n_words': 115}