From f2fcb638bbfd45bdd1494150e3828b90b5e3cddf Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Wed, 13 Jun 2018 09:34:12 +0200 Subject: [PATCH] BUGFIX: Fix baseUri handling for with Neos > 3.3 In Neos 3.3 the Uri object implements the PSR7 Uri interface wich enforces that the getHost method always returns a string. Since the existing implementation of getLinkValue explicitly checked for null currently the detection of host-relative urls did not work any more wich resulted in loosing the baseUri for linked resources. This change check for the host beeing null or an empty string and thus supports old and new Neos versions. --- Classes/HalResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/HalResource.php b/Classes/HalResource.php index 1cc31bd..7d760a5 100644 --- a/Classes/HalResource.php +++ b/Classes/HalResource.php @@ -304,7 +304,7 @@ public function getLinkValue($name, array $variables = []) { $uri = new Uri($this->getLink($name)->getHref($variables)); - if ($uri->getHost() === null) { + if ($uri->getHost() === null || $uri->getHost() === '') { $uri->setScheme($this->baseUri->getScheme()); $uri->setHost($this->baseUri->getHost()); $uri->setPath($this->baseUri->getPath() . $uri->getPath());