<commit_before><?php

require_once('include/enotify.php');
require_once('include/user.php');

function user_allow($hash) {

	$a = get_app();

	$register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1",
		dbesc($hash)
	);


	if(! dbm::is_result($register))
		return false;

	$user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
		intval($register[0]['uid'])
	);

	if(! dbm::is_result($user))
		killme();

	$r = q("DELETE FROM `register` WHERE `hash` = '%s'",
		dbesc($register[0]['hash'])
	);


	$r = q("UPDATE `user` SET `blocked` = 0, `verified` = 1 WHERE `uid` = %d",
		intval($register[0]['uid'])
	);

	$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
		intval($user[0]['uid'])
	);
	if (dbm::is_result($r) && $r[0]['net-publish']) {
		$url = App::get_baseurl() . '/profile/' . $user[0]['nickname'];
		if($url && strlen(get_config('system','directory')))
			proc_run(PRIORITY_LOW, "include/directory.php", $url);<commit_msg>Continued a bit: - converted some bad checks to use dbm::is_result() - added space between "if" and brace - added curly braces<commit_after><?php

require_once('include/enotify.php');
require_once('include/user.php');

function user_allow($hash) {

	$a = get_app();

	$register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1",
		dbesc($hash)
	);


	if (! dbm::is_result($register)) {
		return false;
	}

	$user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
		intval($register[0]['uid'])
	);

	if (! dbm::is_result($user)) {
		killme();
	}

	$r = q("DELETE FROM `register` WHERE `hash` = '%s'",
		dbesc($register[0]['hash'])
	);


	$r = q("UPDATE `user` SET `blocked` = 0, `verified` = 1 WHERE `uid` = %d",
		intval($register[0]['uid'])
	);

	$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
		intval($user[0]['uid'])
	);
	if (dbm::is_result($r) && $r[0]['net-publish']) {
		$url = App::get_baseurl() . '/profile/' . $user[0]['nickname'];
		if($url && strlen(get_config('system','directory')))
			proc_run(PRIORITY_LOW, "include/directory.php", $url);
{'fraction_non_alphanumeric': 0.23723869713174525, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 4.700831024930748, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4773527', 'n_tokens_mistral': 838, 'n_tokens_neox': 792, 'n_words': 171}