/** * Normalize the base signature URL * * @param string $url * @return string */ public function normaliseBaseSignatureUrl($url) { $uri = new \Zend\URI\URL($url); if ($uri->getScheme() == 'http' && $uri->getPort() == '80') { $uri->setPort(''); } elseif ($uri->getScheme() == 'https' && $uri->getPort() == '443') { $uri->setPort(''); } elseif (!in_array($uri->getScheme(), array('http', 'https'))) { throw new OAuthException('Invalid URL provided; must be an HTTP or HTTPS scheme'); } $uri->setQuery(''); $uri->setFragment(''); $uri->setHost(strtolower($uri->getHost())); return $uri->generate(); }