Skip to content

Commit

Permalink
Don't check from CLI in Routes. Fixes #1724
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Feb 17, 2019
1 parent 6bf6403 commit 6ed11c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ protected function create(string $verb, string $from, $to, array $options = null
if (! empty($options['hostname']))
{
// @todo determine if there's a way to whitelist hosts?
if (strtolower($_SERVER['HTTP_HOST']) !== strtolower($options['hostname']))
if (isset($_SERVER['HTTP_HOST']) && strtolower($_SERVER['HTTP_HOST']) !== strtolower($options['hostname']))
{
return;
}
Expand Down Expand Up @@ -1347,6 +1347,12 @@ protected function create(string $verb, string $from, $to, array $options = null
*/
private function checkSubdomains($subdomains)
{
// CLI calls can't be on subdomain.
if (! isset($_SERVER['HTTP_HOST']))
{
return false;
}

if (is_null($this->currentSubdomain))
{
$this->currentSubdomain = $this->determineCurrentSubdomain();
Expand Down

0 comments on commit 6ed11c4

Please sign in to comment.