Skip to content
This repository was archived by the owner on May 3, 2019. It is now read-only.

Commit

Permalink
BUGFIX: cast to string to comply with strict_types
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten85 authored and johannessteu committed Feb 1, 2019
1 parent 365f8e6 commit 107999d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Classes/RoutingComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RoutingComponent extends \Neos\Flow\Mvc\Routing\RoutingComponent
use BlacklistTrait;

/**
* The original routing component uses the concret router, not the interface
* The original routing component uses the concrete router, not the interface
* so it has to be overwritten here
*
* @Flow\Inject
Expand All @@ -49,11 +49,13 @@ public function handle(ComponentContext $componentContext): void
$path = $uri->getPath();

if ($this->configuration['enable'] === true && $path[-1] !== '/') {
if ($this->matchesBlacklist($uri) === false && isset(pathinfo($uri)['extension']) === false) {
$uri->setPath($path . '/');
$response = $componentContext->getHttpResponse();
$response->setStatus($this->configuration['statusCode']);
$response->setHeader('Location', (string) $uri);
if ($this->matchesBlacklist($uri) === false && isset(pathinfo((string) $uri)['extension']) === false) {
$newUri = $uri->withPath($path . '/');
$newResponse = $componentContext->getHttpResponse()
->withStatus($this->configuration['statusCode'])
->withHeader('Location', (string) $newUri);

$componentContext->replaceHttpResponse($newResponse);
$componentContext->setParameter(ComponentChain::class, 'cancel', true);
return;
}
Expand Down

0 comments on commit 107999d

Please sign in to comment.