Merge branch 'develop' of https://github.com/Orange-Management/phpOMS into develop

This commit is contained in:
Dennis Eichhorn 2019-03-09 18:53:39 +01:00
commit 632ce1c4dc
3 changed files with 6 additions and 2 deletions

View File

@ -55,7 +55,7 @@ final class Dispatcher
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(ApplicationAbstract $app) public function __construct(ApplicationAbstract $app = null)
{ {
$this->app = $app; $this->app = $app;
} }

View File

@ -187,7 +187,10 @@ final class Http implements UriInterface
public static function getCurrent() : string public static function getCurrent() : string
{ {
/** @noinspection PhpUndefinedConstantInspection */ /** @noinspection PhpUndefinedConstantInspection */
return 'http://' . ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['REQUEST_URI'] ?? ''); return ((!empty($_SERVER['HTTPS'] ?? '') && ($_SERVER['HTTPS'] ?? '') !== 'off')
|| (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https')
|| (($_SERVER['HTTP_X_FORWARDED_SSL'] ?? '') === 'on') ? 'https' : 'http')
. '://' . ($_SERVER['HTTP_HOST'] ?? ''). ($_SERVER['REQUEST_URI'] ?? '');
} }
/** /**

View File

@ -116,6 +116,7 @@ final class UriFactory
{ {
self::setQuery('/scheme', $uri->getScheme()); self::setQuery('/scheme', $uri->getScheme());
self::setQuery('/host', $uri->getHost()); self::setQuery('/host', $uri->getHost());
self::setQuery('/port', (string) $uri->getPort());
self::setQuery('/base', \rtrim($uri->getBase(), '/')); self::setQuery('/base', \rtrim($uri->getBase(), '/'));
self::setQuery('/rootPath', $uri->getRootPath()); self::setQuery('/rootPath', $uri->getRootPath());
self::setQuery('?', $uri->getQuery()); self::setQuery('?', $uri->getQuery());