Skip to content

Commit

Permalink
BUGFIX: Fix baseUri handling for with Neos > 3.3
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mficzel authored Jun 13, 2018
1 parent 5fbd078 commit f2fcb63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/HalResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit f2fcb63

Please sign in to comment.