WordPress at a glance
function is not described

Requests::match_domain() public WP 1.0

{} It's a method of the class: Requests{}

No Hooks.

Return

````. Null. Nothing.

Usage

$result = Requests::match_domain( $host, $reference );
$host (required)
-
$reference (required)
-

Code of Requests::match_domain() WP 5.7

<?php
public static function match_domain($host, $reference) {
	// Check for a direct match
	if ($host === $reference) {
		return true;
	}

	// Calculate the valid wildcard match if the host is not an IP address
	// Also validates that the host has 3 parts or more, as per Firefox's
	// ruleset.
	$parts = explode('.', $host);
	if (ip2long($host) === false && count($parts) >= 3) {
		$parts[0] = '*';
		$wildcard = implode('.', $parts);
		if ($wildcard === $reference) {
			return true;
		}
	}

	return false;
}