<commit_before><?php


function settings_init(&$a) {
	if(local_user()) {
		require_once("mod/profile.php");
		profile_load($a,$a->user['nickname']);
	}
}


function settings_post(&$a) {

	if(! local_user()) {
		notice( t('Permission denied.') . EOL);
		return;
	}
	if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != get_uid()) {
		notice( t('Permission denied.') . EOL);
		return;
	}
	if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {

		$newpass = trim($_POST['npassword']);
		$confirm = trim($_POST['confirm']);

		$err = false;
		if($newpass != $confirm ) {
			notice( t('Passwords do not match. Password unchanged.') . EOL);
			$err = true;
		}

		if((! x($newpass)) || (! x($confirm))) {
			notice( t('Empty passwords are not allowed. Password unchanged.') . EOL);
			$err = true;
		}

		if(! $err) {<commit_msg>allow leading/trailing whitespace in passwords<commit_after><?php


function settings_init(&$a) {
	if(local_user()) {
		require_once("mod/profile.php");
		profile_load($a,$a->user['nickname']);
	}
}


function settings_post(&$a) {

	if(! local_user()) {
		notice( t('Permission denied.') . EOL);
		return;
	}
	if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != get_uid()) {
		notice( t('Permission denied.') . EOL);
		return;
	}
	if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {

		$newpass = $_POST['npassword'];
		$confirm = $_POST['confirm'];

		$err = false;
		if($newpass != $confirm ) {
			notice( t('Passwords do not match. Password unchanged.') . EOL);
			$err = true;
		}

		if((! x($newpass)) || (! x($confirm))) {
			notice( t('Empty passwords are not allowed. Password unchanged.') . EOL);
			$err = true;
		}

		if(! $err) {
{'fraction_non_alphanumeric': 0.23651452282157676, 'fraction_numerical': 0.0, 'mean_word_length': 4.0843373493975905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3550944', 'n_tokens_mistral': 684, 'n_tokens_neox': 616, 'n_words': 124}