Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/172' into develop
Browse files Browse the repository at this point in the history
Forward port #172
  • Loading branch information
weierophinney committed Jul 24, 2018
2 parents 1f34d81 + 8c7c97b commit f22af98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/PathMiddlewareDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
}

// Current path does not match decorator path
if (substr(strtolower($path), 0, strlen($this->prefix)) !== strtolower($this->prefix)) {
if (0 !== stripos($path, $this->prefix)) {
return $handler->handle($request);
}

Expand Down Expand Up @@ -138,7 +138,7 @@ public function handle(ServerRequestInterface $request) : ResponseInterface
private function normalizePrefix(string $prefix) : string
{
$prefix = strlen($prefix) > 1 ? rtrim($prefix, '/') : $prefix;
if ('/' !== substr($prefix, 0, 1)) {
if (0 !== strpos($prefix, '/')) {
$prefix = '/' . $prefix;
}
return $prefix;
Expand Down

0 comments on commit f22af98

Please sign in to comment.