Skip to content

Commit

Permalink
Merge branch '45-sameHost'
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfunk committed Mar 26, 2014
2 parents 99f35a0 + d18c420 commit 83bcaef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/core/Plain_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ protected function isSameHost()
// Going to execute this better, need to think about it
$host = (isset($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : null;
$origin = (isset($_SERVER['HTTP_REFERER'])) ? strtolower(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)) : null;
return (! empty($origin) && ! empty($host) && $host == $origin) ? true : false;
$port = (isset($_SERVER['SERVER_PORT']) && ! empty($_SERVER['SERVER_PORT'])) ? ':' . $_SERVER['SERVER_PORT'] : null;
return (! empty($origin) && ! empty($host) && ($host == $origin || $host == $origin . $port)) ? true : false;
}

public function isWebView()
Expand Down

0 comments on commit 83bcaef

Please sign in to comment.