Example #1
0
 protected function asProtect($url, $host)
 {
     if (empty($this->_allowedDomains)) {
         if ($_host = $this->request->getHost()) {
             $this->_allowedDomains = [$_host];
         }
     }
     if ($this->protect && isset($this->protectLink) && !in_array($host, $this->_allowedDomains, true)) {
         $this->protectLink = (array) $this->protectLink;
         if (!isset($this->protectLink['@scheme'])) {
             $this->protectLink['@scheme'] = self::ABS;
         }
         return static::modify($this->protectLink) . "?r={$url}";
     }
     return $url;
 }