You are here

public function UriSigner::sign in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/UriSigner.php \Symfony\Component\HttpKernel\UriSigner::sign()

Signs a URI.

The given URI is signed by adding a _hash query string parameter which value depends on the URI and the secret.

Parameters

string $uri A URI to sign:

Return value

string The signed URI

File

vendor/symfony/http-kernel/UriSigner.php, line 43

Class

UriSigner
Signs URIs.

Namespace

Symfony\Component\HttpKernel

Code

public function sign($uri) {
  $url = parse_url($uri);
  if (isset($url['query'])) {
    parse_str($url['query'], $params);
  }
  else {
    $params = array();
  }
  $uri = $this
    ->buildUrl($url, $params);
  return $uri . (false === strpos($uri, '?') ? '?' : '&') . '_hash=' . $this
    ->computeHash($uri);
}