• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/security/weakpassword.php
  • Класс: Bitrix\Main\Security\WeakPassword
  • Вызов: WeakPassword::exists
static function exists(string $password, string $path): bool
{
	$hash = md5($password);
	$name = $hash[0] . $hash[1];

	$indexFile = new IO\File($path . '/' . $name . 'txt');

	if (!$indexFile->isExists())
	{
		return false;
	}

	$passwords = $indexFile->getContents();

	return (strpos($passwords, "\n" . $password . "\n") !== false);
}