class IFrameUrlHelper (View source)

internal  This is an internal part of the oEmbed system and should only be used by oEmbed-related code in Drupal core.
 

Providers helper functions for displaying oEmbed resources in an iFrame.

Properties

protected RequestContext $requestContext

The request context service.

protected PrivateKey $privateKey

The private key service.

Methods

__construct(RequestContext $request_context, PrivateKey $private_key)

IFrameUrlHelper constructor.

string
getHash(string $url, int $max_width = NULL, int $max_height = NULL)

Hashes an oEmbed resource URL.

bool
isSecure(string $url)

Checks if an oEmbed URL can be securely displayed in an frame.

Details

__construct(RequestContext $request_context, PrivateKey $private_key)

IFrameUrlHelper constructor.

Parameters

RequestContext $request_context

The request context service.

PrivateKey $private_key

The private key service.

string getHash(string $url, int $max_width = NULL, int $max_height = NULL)

Hashes an oEmbed resource URL.

Parameters

string $url

The resource URL.

int $max_width

(optional) The maximum width of the resource.

int $max_height

(optional) The maximum height of the resource.

Return Value

string

The hashed URL.

bool isSecure(string $url)

Checks if an oEmbed URL can be securely displayed in an frame.

Parameters

string $url

The URL to check.

Return Value

bool

TRUE if the URL is considered secure, otherwise FALSE.