Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/sink/AphrontHTTPSink.php
Context not available. | |||||
* @return void | * @return void | ||||
*/ | */ | ||||
final public function writeHTTPStatus($code, $message = '') { | final public function writeHTTPStatus($code, $message = '') { | ||||
if (!preg_match('/^\d{3}$/', $code)) { | if (!@preg_match('/^\d{3}$/', $code)) { | ||||
throw new Exception(pht("Malformed HTTP status code '%s'!", $code)); | throw new Exception(pht("Malformed HTTP status code '%s'!", $code)); | ||||
} | } | ||||
Context not available. | |||||
} | } | ||||
list($name, $value) = $header; | list($name, $value) = $header; | ||||
if (strpos($name, ':') !== false) { | if (@strpos($name, ':') !== false) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Declining to emit response with malformed HTTP header name: %s', | 'Declining to emit response with malformed HTTP header name: %s', | ||||
Context not available. | |||||
// | // | ||||
// http://news.php.net/php.internals/57655 | // http://news.php.net/php.internals/57655 | ||||
if (preg_match('/[\r\n\0]/', $name.$value)) { | if (@preg_match('/[\r\n\0]/', $name.$value)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Declining to emit response with unsafe HTTP header: %s', | 'Declining to emit response with unsafe HTTP header: %s', | ||||
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