Пример #1
0
 public function isMatch($cookie, $requestUrl)
 {
     $this->requestUrl = new \webignition\Url\Url($requestUrl);
     $this->setCookie($cookie);
     if (!$this->getDomainMatcher()->isMatch($this->cookie['domain'], $this->requestUrl->getHost())) {
         return false;
     }
     if (!$this->getPathMatcher()->isMatch($this->cookie['path'], $this->requestUrl->getPath())) {
         return false;
     }
     if ($this->cookie['secure'] === true && $this->requestUrl->getScheme() != 'https') {
         return false;
     }
     return true;
 }
 /**
  * 
  * @param \webignition\CssValidatorOutput\Message\Message $message
  * @return boolean
  */
 private function hasRefDomainToIgnore(Message $message)
 {
     if (!$message->isError()) {
         return false;
     }
     /* @var $message \webignition\CssValidatorOutput\Message\Error */
     if ($message->getRef() == '') {
         return false;
     }
     $messageRefUrl = new Url($message->getRef());
     foreach ($this->getConfiguration()->getRefDomainsToIgnore() as $refDomainToIgnore) {
         if ($messageRefUrl->hasHost() && $messageRefUrl->getHost()->isEquivalentTo(new \webignition\Url\Host\Host($refDomainToIgnore))) {
             return true;
         }
     }
     return false;
 }