function _openid_normalize_url

6.x openid.inc _openid_normalize_url($url)
1 call to _openid_normalize_url()
_openid_normalize in drupal-6.x/modules/openid/openid.inc
Normalize the given identifier as per spec.

File

drupal-6.x/modules/openid/openid.inc, line 110
OpenID utility functions.

Code

function _openid_normalize_url($url) {
  $normalized_url = $url;

  if (stristr($url, '://') === FALSE) {
    $normalized_url = 'http://' . $url;
  }

  // Strip the fragment and fragment delimiter if present.
  $normalized_url = strtok($normalized_url, '#');

  if (substr_count($normalized_url, '/') < 3) {
    $normalized_url .= '/';
  }

  return $normalized_url;
}