function UriSigner::buildUrl
2 calls to UriSigner::buildUrl()
- UriSigner::check in vendor/
symfony/ http-foundation/ UriSigner.php - Checks that a URI contains the correct hash. Also checks if the URI has not expired (If you used expiration during signing).
- UriSigner::sign in vendor/
symfony/ http-foundation/ UriSigner.php - Signs a URI.
File
-
vendor/
symfony/ http-foundation/ UriSigner.php, line 130
Class
- UriSigner
- @author Fabien Potencier <fabien@symfony.com>
Namespace
Symfony\Component\HttpFoundationCode
private function buildUrl(array $url, array $params = []) : string {
ksort($params, \SORT_STRING);
$url['query'] = http_build_query($params, '', '&');
$scheme = isset($url['scheme']) ? $url['scheme'] . '://' : '';
$host = $url['host'] ?? '';
$port = isset($url['port']) ? ':' . $url['port'] : '';
$user = $url['user'] ?? '';
$pass = isset($url['pass']) ? ':' . $url['pass'] : '';
$pass = $user || $pass ? "{$pass}@" : '';
$path = $url['path'] ?? '';
$query = $url['query'] ? '?' . $url['query'] : '';
$fragment = isset($url['fragment']) ? '#' . $url['fragment'] : '';
return $scheme . $user . $pass . $host . $port . $path . $query . $fragment;
}