Used By
Used By | Description |
---|---|
wp-includes/Requests/SSL.php: Requests_SSL::match_domain() | Match a hostname against a dNSName reference |
Verify that a reference name is valid
Verifies a dNSName for HTTPS usage, (almost) as per Firefox’s rules:
We modify these rules to be a bit stricter and only allow the wildcard character to be the full first component; that is, with the exclusion of the third rule.
(string) (Required) Reference dNSName
(boolean) Is the name valid?
File: wp-includes/Requests/SSL.php
public static function verify_reference_name($reference) { $parts = explode('.', $reference); // Check the first part of the name $first = array_shift($parts); if (strpos($first, '*') !== false) { // Check that the wildcard is the full part if ($first !== '*') { return false; } // Check that we have at least 3 components (including first) if (count($parts) < 2) { return false; } } // Check the remaining parts foreach ($parts as $part) { if (strpos($part, '*') !== false) { return false; } } // Nothing found, verified! return true; }
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_ssl/verify_reference_name