diff --git a/src/Event/ProxyEvent.php b/src/Event/ProxyEvent.php index 8c707bb..f449443 100644 --- a/src/Event/ProxyEvent.php +++ b/src/Event/ProxyEvent.php @@ -9,6 +9,7 @@ public function __construct($data = array()){ $this->data = $data; } + #[\ReturnTypeWillChange] public function offsetSet($offset, $value){ if(is_null($offset)) { @@ -18,14 +19,17 @@ public function offsetSet($offset, $value){ } } + #[\ReturnTypeWillChange] public function offsetExists($offset){ return isset($this->data[$offset]); } + #[\ReturnTypeWillChange] public function offsetUnset($offset){ unset($this->data[$offset]); } + #[\ReturnTypeWillChange] public function offsetGet($offset){ return isset($this->data[$offset]) ? $this->data[$offset] : null; } diff --git a/src/Plugin/AbstractPlugin.php b/src/Plugin/AbstractPlugin.php index 605cee3..224826f 100644 --- a/src/Plugin/AbstractPlugin.php +++ b/src/Plugin/AbstractPlugin.php @@ -45,7 +45,7 @@ final public function subscribe($dispatcher){ } // dispatch based on filter - final private function route($event_name, ProxyEvent $event){ + private function route($event_name, ProxyEvent $event){ $url = $event['request']->getUri(); // url filter provided and current request url does not match it diff --git a/src/Plugin/CookiePlugin.php b/src/Plugin/CookiePlugin.php index 0d69eff..a394f6f 100644 --- a/src/Plugin/CookiePlugin.php +++ b/src/Plugin/CookiePlugin.php @@ -40,7 +40,7 @@ public function onBeforeRequest(ProxyEvent $event){ // does this cookie belong to this domain? // sometimes domain begins with a DOT indicating all subdomains - deprecated but still in use on some servers... - if(strpos($host, $cookie_domain) !== false){ + if(!empty($host) && strpos($host, $cookie_domain) !== false){ $send_cookies[] = $cookie_name.'='.$cookie_value; } }