Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/Pecee/SimpleRouter/RouterGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,33 @@ public function __construct() {
protected function matchDomain() {
if($this->domain !== null) {

if(is_array($this->domain)) {

$max = count($this->domain);

for($i = 0; $i < $max; $i++) {
$domain = $this->domain[$i];

$parameters = $this->parseParameters($domain, request()->getHost(), '[^.]*');

if($parameters !== null) {
$this->parameters = $parameters;
return true;
}
}

return null;
}

$parameters = $this->parseParameters($this->domain, request()->getHost(), '[^.]*');

if($parameters !== null) {
if ($parameters !== null) {
$this->parameters = $parameters;
return true;
}
}

return null;
}

public function renderRoute(Request $request) {
Expand All @@ -37,7 +58,9 @@ public function renderRoute(Request $request) {
throw new RouterException('Method not allowed');
}

$this->matchDomain();
if($this->matchDomain() === null) {
return null;
}

return parent::renderRoute($request);
}
Expand Down