includes/class-parse-this-html.php
private static function limit_url( $url, $source_url ) {
		if ( ! is_string( $url ) ) {
			return '';
		}

		// HTTP 1.1 allows 8000 chars but the "de-facto" standard supported in all current browsers is 2048.
		if ( strlen( $url ) > 2048 ) {
			return ''; // Return empty rather than a truncated/invalid URL
		}

		// Does not look like a URL.
		if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {
			return '';
		}

		$url = WP_Http::make_absolute_url( $url, $source_url );

		return esc_url_raw( $url, array( 'http', 'https' ) );
	}
private static function limit_url( $url, $source_url ) {
		if ( ! is_string( $url ) ) {
			return '';
		}

		// HTTP 1.1 allows 8000 chars but the "de-facto" standard supported in all current browsers is 2048.
		if ( strlen( $url ) > 2048 ) {
			return ''; // Return empty rather than a truncated/invalid URL
		}

		// Does not look like a URL.
		if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {
			return '';
		}

		$url = WP_Http::make_absolute_url( $url, $source_url );

		return esc_url_raw( $url, array( 'http', 'https' ) );
	}
private static function limit_url ( $ url , $ source_url ) { if ( ! is_string ( $ url ) ) { return '' ; } // HTTP 1.1 allows 8000 chars but the "de-facto" standard supported in all current browsers is 2048. if ( strlen ( $ url ) > 2048 ) { return '' ; // Return empty rather than a truncated/invalid URL } // Does not look like a URL. if ( ! filter_var ( $ url , FILTER_VALIDATE_URL ) ) { return '' ; } $ url = WP_Http :: make_absolute_url ( $ url , $ source_url ) ; return esc_url_raw ( $ url , array ( 'http' , 'https' ) ) ; }
Utility method to limit a given URL to 2,048 characters.

@ignore
@since 4.2.0

@param string $url URL to check for length and validity.
@param string $source_url URL URL to use to resolve relative URLs
@return string Escaped URL if of valid length (< 2048) and makeup. Empty string otherwise.
Utility method to limit a given URL to 2 048 characters .