Vergleich inc/class_stopforumspamchecker.php - 1.8.12 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 87Zeile 87
		$is_spammer = false;
$confidence = 0;


		$is_spammer = false;
$confidence = 0;


		if(filter_var($email, FILTER_VALIDATE_EMAIL) && filter_var($ip_address, FILTER_VALIDATE_IP)) // Calls to the API with invalid email/ip formats cause issues

		if(!filter_var($email, FILTER_VALIDATE_EMAIL))

		{

		{

			$username_encoded = urlencode($username);
$email_encoded = urlencode($email);

			throw new Exception("stopforumspam_invalid_email");
}





			$check_url = sprintf(self::STOP_FORUM_SPAM_API_URL_FORMAT, $username_encoded, $email_encoded, $ip_address);




		if(!filter_var($ip_address, FILTER_VALIDATE_IP))
{
throw new Exception('stopforumspam_invalid_ip_address');
}





			$result = fetch_remote_file($check_url);





		$is_internal_ip = !filter_var(
$ip_address,
FILTER_VALIDATE_IP,
FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE
);





			if($result !== false)
{
$result_json = @json_decode($result);


		if($is_internal_ip)
{
return false;
}





				if($result_json != null && !isset($result_json->error))
{
if($this->check_usernames && $result_json->username->appears)
{
$confidence += $result_json->username->confidence;
}

		$username_encoded = urlencode($username);
$email_encoded = urlencode($email);









					if($this->check_emails && $result_json->email->appears)
{
$confidence += $result_json->email->confidence;
}

		$check_url = sprintf(self::STOP_FORUM_SPAM_API_URL_FORMAT, $username_encoded, $email_encoded, $ip_address);








					if($this->check_ips && $result_json->ip->appears)
{
$confidence += $result_json->ip->confidence;
}

		$result = fetch_remote_file($check_url);








					if($confidence > $this->min_weighting_before_spam)
{
$is_spammer = true;
}






		if($result !== false)
{
$result_json = @json_decode($result);

if($result_json != null && !isset($result_json->error))
{
if($this->check_usernames && $result_json->username->appears)
{
$confidence += $result_json->username->confidence;

				}

				}

				else



if($this->check_emails && $result_json->email->appears)

				{

				{

					throw new Exception('stopforumspam_error_decoding');











					$confidence += $result_json->email->confidence;
}

if($this->check_ips && $result_json->ip->appears)
{
$confidence += $result_json->ip->confidence;
}

if($confidence > $this->min_weighting_before_spam)
{
$is_spammer = true;

				}
}
else
{

				}
}
else
{

				throw new Exception('stopforumspam_error_retrieving');

				throw new Exception('stopforumspam_error_decoding');

			}

			}

 
		}
else
{
throw new Exception('stopforumspam_error_retrieving');

		}

if($this->plugins)

		}

if($this->plugins)