fix: #108 channel redirection
This commit is contained in:
parent
d50d4b0aab
commit
c6896f91c0
2 changed files with 4 additions and 4 deletions
|
@ -530,9 +530,9 @@ class User
|
|||
$this->birthdate = $birthdate;
|
||||
}
|
||||
|
||||
public function getChannel(): string
|
||||
public function getChannel(): string|null
|
||||
{
|
||||
return $this->channel;
|
||||
return $this->channel ?? null;
|
||||
}
|
||||
|
||||
public function setChannel(string $channel): void
|
||||
|
|
|
@ -32,14 +32,14 @@ function redirect(string $target)
|
|||
if (
|
||||
defined('CHANNELS')
|
||||
&& is_array(CHANNELS)
|
||||
&& isset($user->channel)
|
||||
&& $user->getChannel()
|
||||
&& !$isDevEnvironment
|
||||
) {
|
||||
$host = null;
|
||||
|
||||
foreach (CHANNELS as $channel) {
|
||||
if (
|
||||
$channel['branch'] === $user->channel
|
||||
$channel['branch'] === $user->getChannel()
|
||||
&& $channel['host'] !== $_SERVER['HTTP_HOST']
|
||||
&& $isHostInChannel
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue