function _openid_url_normalize

7.x openid.inc _openid_url_normalize($url)

OpenID normalization method: normalize URL identifiers.

1 string reference to '_openid_url_normalize'

File

drupal-7.x/modules/openid/openid.inc, line 309
OpenID utility functions.

Code

function _openid_url_normalize($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;
}