<commit_before><?php
$award_id = intval($REQUEST_DATA['award_id'] ?? 0);

if($award_id > 0)
{
	$award_list = explode(",", npps_query("SELECT unlocked_badge FROM `users` WHERE user_id = $USER_ID")[0][0]);
	
	if(array_search(strval($award_id), $award_list) !== false)
	{
		npps_query("UPDATE `users` SET badge_id = $award_id WHERE user_id = $USER_ID");
		user_set_last_active($USER_ID, $TOKEN);
		
		return [
			[],
			200
		];
	}
}

echo "Invalid award ID";
return false;
<commit_msg>Setting title fixed<commit_after><?php
$award_id = intval($REQUEST_DATA['award_id'] ?? 0);

if($award_id > 0)
{
	$user = npps_user::get_instance($USER_ID);
	$award_list = npps_separate(',', $user->unlocked_title);
	
	if(array_search(strval($award_id), $award_list) !== false)
	{
		$user->title_id = $award_id;
		
		return [
			[],
			200
		];
	}
}

echo 'Invalid award ID';
return ERROR_CODE_OUT_OF_RANG;

{'fraction_non_alphanumeric': 0.16989247311827957, 'fraction_numerical': 0.012903225806451613, 'mean_word_length': 4.032432432432432, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2091911', 'n_tokens_mistral': 418, 'n_tokens_neox': 381, 'n_words': 62}