@@ -125,7 +125,9 @@ discard block |
||
125 | 125 | $url = (isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : 'http') . '://' . ($host = (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'])); |
126 | 126 | $host = explode(':', $host)[0]; |
127 | 127 | $domain = $this->router->collection->getDomain($url); |
128 | - if (!empty($this->request['subdomain']) && $route[0] == '/') $route = trim($this->request['subdomain'], '.') . '.' . $domain . $route; |
|
128 | + if (!empty($this->request['subdomain']) && $route[0] == '/') { |
|
129 | + $route = trim($this->request['subdomain'], '.') . '.' . $domain . $route; |
|
130 | + } |
|
129 | 131 | if ($route[0] == '/') { |
130 | 132 | return ($host != $domain) ? false : true; |
131 | 133 | } elseif ($route[0] != '/' && $host != $domain) { |
@@ -333,13 +335,17 @@ discard block |
||
333 | 335 | { |
334 | 336 | if (is_string($callback) && strpos($callback, '@') !== false) { |
335 | 337 | $routes = explode('@', $callback); |
336 | - if (!isset($routes[1])) $routes[1] = 'index'; |
|
338 | + if (!isset($routes[1])) { |
|
339 | + $routes[1] = 'index'; |
|
340 | + } |
|
337 | 341 | if ($routes[1] == '{method}') { |
338 | 342 | $params = explode('/', preg_replace('#' . str_replace('*', '', $this->request['route']) . '#', '', $this->router->route->getUrl())); |
339 | 343 | $routes[1] = $params[0]; |
340 | 344 | array_shift($params); |
341 | 345 | array_merge($this->request['parameters'], $params); |
342 | - if (preg_match('/[A-Z]/', $routes[1])) return false; |
|
346 | + if (preg_match('/[A-Z]/', $routes[1])) { |
|
347 | + return false; |
|
348 | + } |
|
343 | 349 | $routes[1] = lcfirst(str_replace(' ', '', ucwords(str_replace('-', ' ', $routes[1])))); |
344 | 350 | } |
345 | 351 | $index = isset($this->request['collection_index']) ? $this->request['collection_index'] : 0; |