diff --git a/src/proxy.php b/src/proxy.php index a82f614..158955d 100644 --- a/src/proxy.php +++ b/src/proxy.php @@ -226,7 +226,7 @@ protected function _gatherRequestInfo() */ protected function _loadRoute() { - if(!key_exists('route', $_GET)) + if(!isset($_GET['route'])) throw new Exception("You must supply a 'route' parameter in the request"); $this->_route = $_GET['route']; @@ -256,7 +256,7 @@ protected function _loadRequestMethod() { if($this->_requestMethod !== NULL) return; - if(! key_exists('REQUEST_METHOD', $_SERVER)) + if(! isset($_SERVER['REQUEST_METHOD'])) throw new Exception("Request method unknown"); $method = strtolower($_SERVER['REQUEST_METHOD']); @@ -281,7 +281,7 @@ protected function _loadRequestUserAgent() { if($this->_requestUserAgent !== NULL) return; - if(! key_exists('HTTP_USER_AGENT', $_SERVER)) + if(!isset($_SERVER['HTTP_USER_AGENT'])) throw new Exception("No HTTP User Agent was found"); $this->_requestUserAgent = $_SERVER['HTTP_USER_AGENT']; @@ -305,7 +305,7 @@ protected function _loadContentType() { $this->_loadRawHeaders(); - if(key_exists('Content-Type', $this->_rawHeaders)) + if(isset($this->_rawHeaders['Content-Type'])) $this->_requestContentType = $this->_rawHeaders['Content-Type']; } @@ -336,7 +336,7 @@ protected function _checkPermissions() if($this->_allowedHostnames === NULL) return; - if(key_exists('REMOTE_HOST', $_SERVER)) + if(isset($_SERVER['REMOTE_HOST'])) $host = $_SERVER['REMOTE_HOST']; else $host = $_SERVER['REMOTE_ADDR']; @@ -579,7 +579,7 @@ protected function _buildProxyRequestCookieString() { $cookie_string = ''; - if(key_exists('Cookie', $this->_rawHeaders)) + if(isset($this->_rawHeaders['Cookie'])) $cookie_string = $this->_rawHeaders['Cookie']; return $cookie_string;