<commit_before><?php

/*
	WildPHP - a modular and easily extendable IRC bot written in PHP
	Copyright (C) 2015 WildPHP

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

namespace WildPHP\Modules;

class Auth extends \WildPHP\BaseModule
{
	private $hostnames;
	private $pass;

	public function setup()
	{
		$this->hostnames = $this->bot->getConfig('hosts');
	}

	public function authUser($hostname)
	{
		// Remove the nickname from the hostname to also match with that. The nickname doesn't have to always be the same!
		$hostnonick = preg_replace("/[a-zA-Z0-9_\-\\\[\]\{\}\^`\|]+\!/", "", $hostname);
		$result = !empty($hostname) && (in_array($hostname, $this->hostnames) || in_array($hostnonick, $this->hostnames));

		$this->bot->log('Checking authorization for hostname ' . $hostname . ': ' . ($result ? 'Authorized' : 'Unauthorized'), 'AUTH');

		return $result;
	}
}
<commit_msg>No double quotes in Auth module.<commit_after><?php

/*
	WildPHP - a modular and easily extendable IRC bot written in PHP
	Copyright (C) 2015 WildPHP

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

namespace WildPHP\Modules;

class Auth extends \WildPHP\BaseModule
{
	private $hostnames;
	private $pass;

	public function setup()
	{
		$this->hostnames = $this->bot->getConfig('hosts');
	}

	public function authUser($hostname)
	{
		// Remove the nickname from the hostname to also match with that. The nickname doesn't have to always be the same!
		$hostnonick = preg_replace('/[a-zA-Z0-9_\-\\\[\]\{\}\^`\|]+\!/', '', $hostname);
		$result = !empty($hostname) && (in_array($hostname, $this->hostnames) || in_array($hostnonick, $this->hostnames));

		$this->bot->log('Checking authorization for hostname ' . $hostname . ': ' . ($result ? 'Authorized' : 'Unauthorized'), 'AUTH');

		return $result;
	}
}

{'fraction_non_alphanumeric': 0.11586816173972138, 'fraction_numerical': 0.004757050628610262, 'mean_word_length': 4.049742710120069, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1266977', 'n_tokens_mistral': 904, 'n_tokens_neox': 849, 'n_words': 351}