protected static function sanitize_iri_value($str = '') {
		$allowed_protocols = static::get_allowed_protocols();
		$allowed_domains = static::get_allowed_domains();

		if (wp_kses_bad_protocol($str, $allowed_protocols) !== $str) {
			return '';
		}

		// Assign a protocol.
		$str = preg_replace('/^\/\//', 'https://', $str);

		// Is this a URLish thing?
		if (filter_var($str, FILTER_SANITIZE_URL) !== $str) {
			return '';
		}

		// Check the domain, if applicable.
		if (preg_match('/^[\w\d]+:\/\//i', $str)) {
			if (false !== ($domain = static::sanitize_domain($str))) {
				if (!in_array($domain, $allowed_domains, true)) {
					return '';
				}
			} else {
				return '';
			}
		}

		return $str;
	}
protected static function sanitize_iri_value($str = '') {
		$allowed_protocols = static::get_allowed_protocols();
		$allowed_domains = static::get_allowed_domains();

		if (wp_kses_bad_protocol($str, $allowed_protocols) !== $str) {
			return '';
		}

		// Assign a protocol.
		$str = preg_replace('/^\/\//', 'https://', $str);

		// Is this a URLish thing?
		if (filter_var($str, FILTER_SANITIZE_URL) !== $str) {
			return '';
		}

		// Check the domain, if applicable.
		if (preg_match('/^[\w\d]+:\/\//i', $str)) {
			if (false !== ($domain = static::sanitize_domain($str))) {
				if (!in_array($domain, $allowed_domains, true)) {
					return '';
				}
			} else {
				return '';
			}
		}

		return $str;
	}
protected static function sanitize_iri_value ( $ str = '' ) { $ allowed_protocols = static :: get_allowed_protocols ( ) ; $ allowed_domains = static :: get_allowed_domains ( ) ; if ( wp_kses_bad_protocol ( $ str , $ allowed_protocols ) !== $ str ) { return '' ; } // Assign a protocol. $ str = preg_replace ( '/^\/\//' , 'https://' , $ str ) ; // Is this a URLish thing? if ( filter_var ( $ str , FILTER_SANITIZE_URL ) !== $ str ) { return '' ; } // Check the domain, if applicable. if ( preg_match ( '/^[\w\d]+:\/\//i' , $ str ) ) { if ( false !== ( $ domain = static :: sanitize_domain ( $ str ) ) ) { if ( ! in_array ( $ domain , $ allowed_domains , true ) ) { return '' ; } } else { return '' ; } } return $ str ; }
Sanitize IRI value

@param string $str IRI value.
@return string IRI value.
Sanitize IRI value