protected function toRefererUrl(Zend_Uri $uri)
 {
     if ($uri->getPort() == '80') {
         return $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath() . $uri->getQuery();
     }
     return (string) $uri;
 }
 /**
  * Make sure we get the correct domain when it's set in a reference URL
  *
  * @dataProvider refUrlProvider
  */
 public function testGetDomainInRefUrl(Zend_Uri $uri)
 {
     $domain = $uri->getHost();
     $cookie = Zend_Http_Cookie::fromString('foo=baz; path=/', 'http://' . $domain);
     if (!$cookie instanceof Zend_Http_Cookie) {
         $this->fail("Failed creating a cookie object with URL '{$uri}'");
     }
     $this->assertEquals($domain, $cookie->getDomain());
 }
示例#3
0
 /**
  * ignore port and fragment
  * for match siteinfo(wedata)'s url-regex
  *
  */
 private function toUrl(Zend_Uri $uri)
 {
     $port = $uri->getPort();
     $port = ($port > 0 and $port != '80') ? ':' . $port : '';
     return $uri->getScheme() . '://' . $uri->getHost() . $port . $uri->getPath() . $uri->getQuery();
 }