You are here

function _oauth_common_glue_url in OAuth 1.0 6.3

Same name and namespace in other branches
  1. 7.4 oauth_common.pages.inc \_oauth_common_glue_url()
  2. 7.3 oauth_common.pages.inc \_oauth_common_glue_url()

Constructs the url to which to return someone who has asked for access to a consumer

2 calls to _oauth_common_glue_url()
oauth_common_form_authorize in ./oauth_common.pages.inc
Form for granting access to the consumer
oauth_common_form_authorize_submit in ./oauth_common.pages.inc
Form submit handler that grants access to the consumer

File

./oauth_common.pages.inc, line 307

Code

function _oauth_common_glue_url($parsed) {
  $uri = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : '';
  $uri .= isset($parsed['user']) ? $parsed['user'] . (isset($parsed['pass']) ? ':' . $parsed['pass'] : '') . '@' : '';
  $uri .= isset($parsed['host']) ? $parsed['host'] : '';
  $uri .= isset($parsed['port']) ? ':' . $parsed['port'] : '';
  if (isset($parsed['path'])) {
    $uri .= substr($parsed['path'], 0, 1) == '/' ? $parsed['path'] : (!empty($uri) ? '/' : '') . $parsed['path'];
  }
  $uri .= isset($parsed['query']) ? '?' . $parsed['query'] : '';
  return $uri;
}