Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/AphrontRequest.php
Context not available. | |||||
} | } | ||||
public static function parseURILineRange($range, $limit) { | public static function parseURILineRange($range, $limit) { | ||||
if (!strlen($range)) { | if (!@strlen($range)) { | ||||
return null; | return null; | ||||
} | } | ||||
$range = explode('-', $range, 2); | $range = @explode('-', $range, 2); | ||||
foreach ($range as $key => $value) { | foreach ($range as $key => $value) { | ||||
$value = (int)$value; | $value = (int)$value; | ||||
Context not available. | |||||
$raw_data = phutil_string_cast($this->requestData[$name]); | $raw_data = phutil_string_cast($this->requestData[$name]); | ||||
$raw_data = trim($raw_data); | $raw_data = trim($raw_data); | ||||
if (!strlen($raw_data)) { | if (!@strlen($raw_data)) { | ||||
return $default; | return $default; | ||||
} | } | ||||
Context not available. | |||||
} | } | ||||
private function getPrefixedCookieName($name) { | private function getPrefixedCookieName($name) { | ||||
if (strlen($this->cookiePrefix)) { | if (@strlen($this->cookiePrefix)) { | ||||
return $this->cookiePrefix.'_'.$name; | return $this->cookiePrefix.'_'.$name; | ||||
} else { | } else { | ||||
return $name; | return $name; | ||||
Context not available. | |||||
// domain is. This makes setup easier, and we'll tell administrators to | // domain is. This makes setup easier, and we'll tell administrators to | ||||
// configure a base domain during the setup process. | // configure a base domain during the setup process. | ||||
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | $base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | ||||
if (!strlen($base_uri)) { | if (!@strlen($base_uri)) { | ||||
return new PhutilURI('http://'.$host.'/'); | return new PhutilURI('http://'.$host.'/'); | ||||
} | } | ||||
Context not available. | |||||
// NOTE: apache_request_headers() might provide a nicer way to do this, | // NOTE: apache_request_headers() might provide a nicer way to do this, | ||||
// but isn't available under FCGI until PHP 5.4.0. | // but isn't available under FCGI until PHP 5.4.0. | ||||
foreach ($_SERVER as $key => $value) { | foreach ($_SERVER as $key => $value) { | ||||
if (!preg_match('/^HTTP_/', $key)) { | if (!@preg_match('/^HTTP_/', $key)) { | ||||
continue; | continue; | ||||
} | } | ||||
// Unmangle the header as best we can. | // Unmangle the header as best we can. | ||||
$key = substr($key, strlen('HTTP_')); | $key = @substr($key, @strlen('HTTP_')); | ||||
$key = str_replace('_', ' ', $key); | $key = str_replace('_', ' ', $key); | ||||
$key = strtolower($key); | $key = @strtolower($key); | ||||
$key = ucwords($key); | $key = ucwords($key); | ||||
$key = str_replace(' ', '-', $key); | $key = str_replace(' ', '-', $key); | ||||
Context not available. | |||||
$should_forward = false; | $should_forward = false; | ||||
// Forward "X-Hgarg-..." headers. | // Forward "X-Hgarg-..." headers. | ||||
if (preg_match('/^X-Hgarg-/', $key)) { | if (@preg_match('/^X-Hgarg-/', $key)) { | ||||
$should_forward = true; | $should_forward = true; | ||||
} | } | ||||
Context not available. | |||||
$submit_cookie = PhabricatorCookies::COOKIE_SUBMIT; | $submit_cookie = PhabricatorCookies::COOKIE_SUBMIT; | ||||
$submit_key = $this->getCookie($submit_cookie); | $submit_key = $this->getCookie($submit_cookie); | ||||
if (strlen($submit_key)) { | if (@strlen($submit_key)) { | ||||
$this->clearCookie($submit_cookie); | $this->clearCookie($submit_cookie); | ||||
$this->submitKey = $submit_key; | $this->submitKey = $submit_key; | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0