protected function normalizeUrl()

in js/plugins/ajax-contact-extend/classes/twitter/EpiOAuth.php [141:160]


  protected function normalizeUrl($url = null)
  {
  $urlParts = parse_url($url);
  $scheme = strtolower($urlParts['scheme']);
  $host   = strtolower($urlParts['host']);
  $port = intval($urlParts['port']);

  $retval = "{$scheme}://{$host}";
  if($port > 0 && ($scheme === 'http' && $port !== 80) || ($scheme === 'https' && $port !== 443))
  {
    $retval .= ":{$port}";
  }
  $retval .= $urlParts['path'];
  if(!empty($urlParts['query']))
  {
    $retval .= "?{$urlParts['query']}";
  }

  return $retval;
  }