You are here

protected function DrupalOAuthClient::getAbsolutePath in OAuth 1.0 7.4

Same name and namespace in other branches
  1. 6.3 includes/DrupalOAuthClient.inc \DrupalOAuthClient::getAbsolutePath()
  2. 7.3 includes/DrupalOAuthClient.inc \DrupalOAuthClient::getAbsolutePath()

Makes sure a path is an absolute path

Prepends provider url if the path isn't absolute.

Parameters

string $path: The path to make absolute.

Return value

string The absolute path.

2 calls to DrupalOAuthClient::getAbsolutePath()
DrupalOAuthClient::get in includes/DrupalOAuthClient.inc
Make an OAuth request.
DrupalOAuthClient::getAuthorizationUrl in includes/DrupalOAuthClient.inc
Constructs the url that the user should be sent to to authorize the request token.

File

includes/DrupalOAuthClient.inc, line 363

Class

DrupalOAuthClient

Code

protected function getAbsolutePath($path) {
  $protocols = array(
    'http',
    'https',
  );
  $protocol = strpos($path, '://');
  $protocol = $protocol ? substr($path, 0, $protocol) : '';
  if (!in_array($protocol, $protocols)) {
    $path = $this->consumer->configuration['provider_url'] . $path;
  }
  return $path;
}