Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IFrameUrlHelper.php

function IFrameUrlHelper::getHash

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.

File

core/modules/media/src/IFrameUrlHelper.php, line 59

Class

IFrameUrlHelper
Providers helper functions for displaying oEmbed resources in an iFrame.

Namespace

Drupal\media

Code

public function getHash($url, $max_width = NULL, $max_height = NULL) {
    return Crypt::hmacBase64("{$url}:{$max_width}:{$max_height}", $this->privateKey
        ->get() . Settings::getHashSalt());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal