public function match(FilterableUri $uri)
 {
     if (null !== $uri->getQuery()) {
         $uri->setFiltered(true, 'URI with query string');
         return true;
     }
     return false;
 }
 public function match(FilterableUri $uri)
 {
     if (null !== $uri->getFragment()) {
         $uri->setFiltered(true, 'URI with hash fragment');
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * @return bool
  */
 public function match(FilterableUri $uri)
 {
     $scheme = $uri->getScheme();
     if (!in_array($scheme, $this->allowedSchemes)) {
         $uri->setFiltered(true, 'Scheme not allowed');
         return true;
     }
     return false;
 }
 public function match(FilterableUri $uri)
 {
     /*
      * if the URI does not contain the seed, it is not allowed
      */
     if (false === stripos($uri->toString(), $this->seed->toString())) {
         $uri->setFiltered(true, 'Doesn\'t match base URI');
         return true;
     }
     return false;
 }
Exemplo n.º 5
0
 public function match(FilterableUri $uri)
 {
     $currentHostname = $uri->getHost();
     if ($this->allowSubDomains) {
         // only use hostname.tld for comparison
         $currentHostname = join('.', array_slice(explode('.', $currentHostname), -2));
     }
     if (!in_array($currentHostname, $this->allowedHosts)) {
         $uri->setFiltered(true, 'Hostname not allowed');
         return true;
     }
     return false;
 }