From f1435542438ff7fc3ac5ba94cbd4bbdb7a89b5f1 Mon Sep 17 00:00:00 2001 From: Kyle Taylor Date: Fri, 30 Jun 2023 15:14:31 -0500 Subject: [PATCH 1/2] Add support for PHP 8.1 / 8.2 --- src/Event/ProxyEvent.php | 4 ++++ src/Plugin/AbstractPlugin.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 From 26212c04bb2e0f1dde4e8c47248ed637978c1085 Mon Sep 17 00:00:00 2001 From: Kyle Taylor Date: Fri, 30 Jun 2023 15:58:20 -0500 Subject: [PATCH 2/2] Fix strpos deprecation --- src/Plugin/CookiePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }