Upgrade to 3.6.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Kirby\Http;
|
||||
|
||||
use Kirby\Toolkit\F;
|
||||
use Kirby\Filesystem\F;
|
||||
|
||||
/**
|
||||
* The Header class provides methods
|
||||
|
@@ -43,7 +43,7 @@ class Query extends Obj
|
||||
|
||||
public function toString($questionMark = false): string
|
||||
{
|
||||
$query = http_build_query($this);
|
||||
$query = http_build_query($this, null, '&', PHP_QUERY_RFC3986);
|
||||
|
||||
if (empty($query) === true) {
|
||||
return '';
|
||||
|
@@ -5,7 +5,7 @@ namespace Kirby\Http;
|
||||
use Exception;
|
||||
use Kirby\Cms\App;
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Toolkit\F;
|
||||
use Kirby\Filesystem\F;
|
||||
use Kirby\Toolkit\Str;
|
||||
|
||||
/**
|
||||
@@ -104,6 +104,13 @@ class Remote
|
||||
{
|
||||
$defaults = static::$defaults;
|
||||
|
||||
// use the system CA store by default if
|
||||
// one has been configured in php.ini
|
||||
$cainfo = ini_get('curl.cainfo');
|
||||
if (empty($cainfo) === false && is_file($cainfo) === true) {
|
||||
$defaults['ca'] = self::CA_SYSTEM;
|
||||
}
|
||||
|
||||
// update the defaults with App config if set;
|
||||
// request the App instance lazily
|
||||
$app = App::instance(null, true);
|
||||
|
@@ -6,7 +6,6 @@ use Kirby\Http\Request\Auth\BasicAuth;
|
||||
use Kirby\Http\Request\Auth\BearerAuth;
|
||||
use Kirby\Http\Request\Body;
|
||||
use Kirby\Http\Request\Files;
|
||||
use Kirby\Http\Request\Method;
|
||||
use Kirby\Http\Request\Query;
|
||||
use Kirby\Toolkit\A;
|
||||
use Kirby\Toolkit\Str;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace Kirby\Http;
|
||||
|
||||
use Exception;
|
||||
use Kirby\Toolkit\F;
|
||||
use Kirby\Filesystem\F;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
|
@@ -119,13 +119,21 @@ class Server
|
||||
*/
|
||||
public static function port(bool $forwarded = false): int
|
||||
{
|
||||
$port = $forwarded === true ? static::get('HTTP_X_FORWARDED_PORT') : null;
|
||||
|
||||
if (empty($port) === true) {
|
||||
$port = static::get('SERVER_PORT');
|
||||
// based on forwarded port
|
||||
if ($forwarded === true) {
|
||||
if ($port = static::get('HTTP_X_FORWARDED_PORT')) {
|
||||
return $port;
|
||||
}
|
||||
}
|
||||
|
||||
return $port;
|
||||
// based on HTTP host
|
||||
$host = static::get('HTTP_HOST');
|
||||
if ($pos = strpos($host, ':')) {
|
||||
return (int)substr($host, $pos + 1);
|
||||
}
|
||||
|
||||
// based on server port
|
||||
return static::get('SERVER_PORT');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Kirby\Http;
|
||||
|
||||
use Kirby\Filesystem\Mime;
|
||||
use Kirby\Toolkit\Collection;
|
||||
use Kirby\Toolkit\Mime;
|
||||
use Kirby\Toolkit\Obj;
|
||||
use Kirby\Toolkit\Str;
|
||||
|
||||
|
Reference in New Issue
Block a user