Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/AphrontRequest.php
Show First 20 Lines • Show All 536 Lines • ▼ Show 20 Lines | public function getRequestURI() { | ||||
$path = phutil_escape_uri($this->getPath()); | $path = phutil_escape_uri($this->getPath()); | ||||
return id(new PhutilURI($path))->setQueryParams($get); | return id(new PhutilURI($path))->setQueryParams($get); | ||||
} | } | ||||
public function isDialogFormPost() { | public function isDialogFormPost() { | ||||
return $this->isFormPost() && $this->getStr('__dialog__'); | return $this->isFormPost() && $this->getStr('__dialog__'); | ||||
} | } | ||||
public function getRemoteAddr() { | public function getRemoteAddress() { | ||||
return $_SERVER['REMOTE_ADDR']; | $address = $_SERVER['REMOTE_ADDR']; | ||||
if (!strlen($address)) { | |||||
return null; | |||||
} | |||||
return substr($address, 0, 64); | |||||
} | } | ||||
public function isHTTPS() { | public function isHTTPS() { | ||||
if (empty($_SERVER['HTTPS'])) { | if (empty($_SERVER['HTTPS'])) { | ||||
return false; | return false; | ||||
} | } | ||||
if (!strcasecmp($_SERVER['HTTPS'], 'off')) { | if (!strcasecmp($_SERVER['HTTPS'], 'off')) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |