mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 03:54:04 +00:00
Fix tenant_route without absolute
This commit is contained in:
parent
8f9c7efa45
commit
399e6f0baf
2 changed files with 2 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ if (! function_exists('tenant_route')) {
|
|||
{
|
||||
// replace first occurance of hostname fragment with $domain
|
||||
$url = route($route, $parameters, $absolute);
|
||||
$hostname = parse_url($url, PHP_URL_HOST);
|
||||
$hostname = parse_url($url, PHP_URL_HOST) ?? '';
|
||||
$position = strpos($url, $hostname);
|
||||
|
||||
return substr_replace($url, $domain, $position, strlen($hostname));
|
||||
|
|
|
|||
|
|
@ -42,5 +42,6 @@ class RedirectTest extends TestCase
|
|||
|
||||
$this->assertSame('http://foo.localhost/abcdef/as/df', tenant_route('foo.localhost', 'foo', ['a' => 'as', 'b' => 'df']));
|
||||
$this->assertSame('http://foo.localhost/abcdef', tenant_route('foo.localhost', 'foo', []));
|
||||
$this->assertSame('foo.localhost/abcdef', tenant_route('foo.localhost', 'foo', [], false));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue