Upgrade to 3.2.5
This commit is contained in:
@@ -16,7 +16,6 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class Cookie
|
||||
{
|
||||
|
||||
/**
|
||||
* Key to use for cookie signing
|
||||
* @var string
|
||||
|
@@ -16,7 +16,6 @@ use Kirby\Toolkit\F;
|
||||
*/
|
||||
class Header
|
||||
{
|
||||
|
||||
// configuration
|
||||
public static $codes = [
|
||||
|
||||
@@ -139,7 +138,7 @@ class Header
|
||||
$code = substr($code, 0, 3);
|
||||
} else {
|
||||
$code = array_key_exists('_' . $code, $codes) === false ? 500 : $code;
|
||||
$message = isset($codes['_' . $code]) ? $codes['_' . $code] : 'Something went wrong';
|
||||
$message = $codes['_' . $code] ?? 'Something went wrong';
|
||||
}
|
||||
|
||||
$header = $protocol . ' ' . $code . ' ' . $message;
|
||||
@@ -302,7 +301,7 @@ class Header
|
||||
|
||||
header('Pragma: public');
|
||||
header('Expires: 0');
|
||||
header('Last-Modified: '. gmdate('D, d M Y H:i:s', $options['modified']) . ' GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $options['modified']) . ' GMT');
|
||||
header('Content-Disposition: attachment; filename="' . $options['name'] . '"');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
|
||||
|
@@ -12,7 +12,7 @@ use TrueBV\Punycode;
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
*/
|
||||
class Idn
|
||||
{
|
||||
public static function decode(string $domain)
|
||||
|
@@ -17,7 +17,6 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class Params extends Query
|
||||
{
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
|
@@ -18,7 +18,6 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class Remote
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -285,7 +284,7 @@ class Remote
|
||||
* Decode the response content
|
||||
*
|
||||
* @param bool $array decode as array or object
|
||||
* @return array|stdClass
|
||||
* @return array|\stdClass
|
||||
*/
|
||||
public function json(bool $array = true)
|
||||
{
|
||||
|
@@ -24,7 +24,6 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class Request
|
||||
{
|
||||
|
||||
/**
|
||||
* The auth object if available
|
||||
*
|
||||
@@ -132,7 +131,7 @@ class Request
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __debuginfo(): array
|
||||
public function __debugInfo(): array
|
||||
{
|
||||
return [
|
||||
'body' => $this->body(),
|
||||
@@ -150,13 +149,13 @@ class Request
|
||||
*/
|
||||
public function ajax(): bool
|
||||
{
|
||||
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest');
|
||||
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Auth object if authentication is set
|
||||
*
|
||||
* @return Kirby\Http\Request\Auth\BasicAuth|Kirby\Http\Request\Auth\BearerAuth|null
|
||||
* @return \Kirby\Http\Request\Auth\BasicAuth|\Kirby\Http\Request\Auth\BearerAuth|null
|
||||
*/
|
||||
public function auth()
|
||||
{
|
||||
@@ -182,7 +181,7 @@ class Request
|
||||
/**
|
||||
* Returns the Body object
|
||||
*
|
||||
* @return Kirby\Http\Request\Body
|
||||
* @return \Kirby\Http\Request\Body
|
||||
*/
|
||||
public function body()
|
||||
{
|
||||
@@ -244,7 +243,7 @@ class Request
|
||||
/**
|
||||
* Returns the Files object
|
||||
*
|
||||
* @return Kirby\Cms\Files
|
||||
* @return \Kirby\Cms\Files
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
@@ -354,7 +353,7 @@ class Request
|
||||
/**
|
||||
* Returns the Query object
|
||||
*
|
||||
* @return Kirby\Http\Query
|
||||
* @return \Kirby\Http\Query
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
@@ -378,7 +377,7 @@ class Request
|
||||
* the original object.
|
||||
*
|
||||
* @param array $props
|
||||
* @return Kirby\Http\Uri
|
||||
* @return \Kirby\Http\Uri
|
||||
*/
|
||||
public function url(array $props = null)
|
||||
{
|
||||
|
@@ -9,7 +9,6 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class BasicAuth extends BearerAuth
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
@@ -7,7 +7,6 @@ namespace Kirby\Http\Request\Auth;
|
||||
*/
|
||||
class BearerAuth
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
@@ -18,13 +18,12 @@ namespace Kirby\Http\Request;
|
||||
*/
|
||||
trait Data
|
||||
{
|
||||
|
||||
/**
|
||||
* Improved `var_dump` output
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __debuginfo(): array
|
||||
public function __debugInfo(): array
|
||||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
|
@@ -3,9 +3,8 @@
|
||||
namespace Kirby\Http;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
|
||||
use Kirby\Toolkit\F;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Representation of an Http response,
|
||||
@@ -20,7 +19,6 @@ use Kirby\Toolkit\F;
|
||||
*/
|
||||
class Response
|
||||
{
|
||||
|
||||
/**
|
||||
* Store for all registered headers,
|
||||
* which will be sent with the response
|
||||
@@ -63,6 +61,8 @@ class Response
|
||||
* @param string $body
|
||||
* @param string $type
|
||||
* @param integer $code
|
||||
* @param array $headers
|
||||
* @param string $charset
|
||||
*/
|
||||
public function __construct($body = '', ?string $type = null, ?int $code = null, ?array $headers = null, ?string $charset = null)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ class Response
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function __debuginfo(): array
|
||||
public function __debugInfo(): array
|
||||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
@@ -183,6 +183,7 @@ class Response
|
||||
* Creates a response for a file and
|
||||
* sends the file content to the browser
|
||||
*
|
||||
* @param string $file
|
||||
* @return self
|
||||
*/
|
||||
public static function file(string $file)
|
||||
|
@@ -13,7 +13,6 @@ use Closure;
|
||||
*/
|
||||
class Route
|
||||
{
|
||||
|
||||
/**
|
||||
* The callback action function
|
||||
*
|
||||
@@ -92,6 +91,7 @@ class Route
|
||||
* @param string|array $pattern
|
||||
* @param string|array $method
|
||||
* @param Closure $action
|
||||
* @param array $attributes
|
||||
*/
|
||||
public function __construct($pattern, $method = 'GET', Closure $action, array $attributes = [])
|
||||
{
|
||||
|
@@ -129,7 +129,7 @@ class Router
|
||||
* @param string $path
|
||||
* @param string $method
|
||||
* @param array $ignore
|
||||
* @return Kirby\Http\Route|null
|
||||
* @return \Kirby\Http\Route|null
|
||||
*/
|
||||
public function find(string $path, string $method, array $ignore = null)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ class Router
|
||||
* once Router::find() has been called
|
||||
* and only if a route was found.
|
||||
*
|
||||
* @return Kirby\Http\Route|null
|
||||
* @return \Kirby\Http\Route|null
|
||||
*/
|
||||
public function route()
|
||||
{
|
||||
|
@@ -14,7 +14,6 @@ namespace Kirby\Http;
|
||||
*/
|
||||
class Server
|
||||
{
|
||||
|
||||
/**
|
||||
* Cache for the cli status
|
||||
*
|
||||
@@ -105,7 +104,7 @@ class Server
|
||||
break;
|
||||
case 'SERVER_PORT':
|
||||
case 'HTTP_X_FORWARDED_PORT':
|
||||
$value = intval(preg_replace('![^0-9]+!', '', $value));
|
||||
$value = (int)(preg_replace('![^0-9]+!', '', $value));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Kirby\Http;
|
||||
|
||||
use Throwable;
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Toolkit\Properties;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Uri builder class
|
||||
@@ -393,7 +393,7 @@ class Uri
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Kirby\Http\Params|string|array|null $path
|
||||
* @param Kirby\Http\Params|string|array|null $params
|
||||
* @return self
|
||||
*/
|
||||
public function setParams($params = null)
|
||||
@@ -413,7 +413,7 @@ class Uri
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Kirby\Http\Path|string|array|null $path
|
||||
* @param \Kirby\Http\Path|string|array|null $path
|
||||
* @return self
|
||||
*/
|
||||
public function setPath($path = null)
|
||||
@@ -423,7 +423,7 @@ class Uri
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $port
|
||||
* @param int|null $port
|
||||
* @return self
|
||||
*/
|
||||
public function setPort(int $port = null)
|
||||
@@ -443,7 +443,7 @@ class Uri
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Kirby\Http\Query|string|array|null $query
|
||||
* @param \Kirby\Http\Query|string|array|null $query
|
||||
* @return self
|
||||
*/
|
||||
public function setQuery($query = null)
|
||||
|
@@ -15,7 +15,6 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class Url
|
||||
{
|
||||
|
||||
/**
|
||||
* The base Url to build absolute Urls from
|
||||
*
|
||||
@@ -112,6 +111,7 @@ class Url
|
||||
/**
|
||||
* Checks if an URL is absolute
|
||||
*
|
||||
* @param string $url
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isAbsolute(string $url = null): bool
|
||||
@@ -278,7 +278,7 @@ class Url
|
||||
* Converts the Url to a Uri object
|
||||
*
|
||||
* @param string $url
|
||||
* @return Kirby\Http\Uri
|
||||
* @return \Kirby\Http\Uri
|
||||
*/
|
||||
public static function toObject($url = null)
|
||||
{
|
||||
|
@@ -17,10 +17,9 @@ use Kirby\Toolkit\Str;
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
*/
|
||||
class Visitor
|
||||
{
|
||||
|
||||
/**
|
||||
* IP address
|
||||
* @var string|null
|
||||
@@ -68,7 +67,7 @@ class Visitor
|
||||
* accepted language otherwise
|
||||
*
|
||||
* @param string|null $acceptedLanguage
|
||||
* @return Kirby\Toolkit\Obj|Kirby\Http\Visitor|null
|
||||
* @return \Kirby\Toolkit\Obj|\Kirby\Http\Visitor|null
|
||||
*/
|
||||
public function acceptedLanguage(string $acceptedLanguage = null)
|
||||
{
|
||||
@@ -84,7 +83,7 @@ class Visitor
|
||||
* Returns an array of all accepted languages
|
||||
* including their quality and locale
|
||||
*
|
||||
* @return Kirby\Toolkit\Collection
|
||||
* @return \Kirby\Toolkit\Collection
|
||||
*/
|
||||
public function acceptedLanguages()
|
||||
{
|
||||
@@ -135,7 +134,7 @@ class Visitor
|
||||
* accepted mime type otherwise
|
||||
*
|
||||
* @param string|null $acceptedMimeType
|
||||
* @return Kirby\Toolkit\Obj|Kirby\Http\Visitor
|
||||
* @return \Kirby\Toolkit\Obj|\Kirby\Http\Visitor
|
||||
*/
|
||||
public function acceptedMimeType(string $acceptedMimeType = null)
|
||||
{
|
||||
@@ -150,7 +149,7 @@ class Visitor
|
||||
/**
|
||||
* Returns a collection of all accepted mime types
|
||||
*
|
||||
* @return Kirby\Toolkit\Collection
|
||||
* @return \Kirby\Toolkit\Collection
|
||||
*/
|
||||
public function acceptedMimeTypes()
|
||||
{
|
||||
|
Reference in New Issue
Block a user