Merge branch 'develop' of github.com:getgrav/grav into develop

This commit is contained in:
Andy Miller 2021-09-13 17:41:08 -06:00
commit a446152631
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0
3 changed files with 12 additions and 4 deletions

View File

@ -11,6 +11,8 @@
3. [](#bugfix)
* Fixed escaping in PageIndex::getLevelListing()
* Fixed validation of `number` type [#3433](https://github.com/getgrav/grav/issues/3433)
* Fixed excessive `security.yaml` file creation [#3432](https://github.com/getgrav/grav/issues/3432)
* Fixed incorrect port :0 with nginx unix socket setup [#3439](https://github.com/getgrav/grav/issues/3439)
# v1.7.20
## 09/01/2021

View File

@ -400,8 +400,12 @@ class Setup extends Data
$this->initializeLocator($locator);
}
// Create security.yaml if it doesn't exist.
$filename = $locator->findResource(static::$securityFile, true, true);
// Create security.yaml salt if it doesn't exist into existing configuration environment if possible.
$securityFile = basename(static::$securityFile);
$securityFolder = substr(static::$securityFile, 0, -\strlen($securityFile));
$securityFolder = $locator->findResource($securityFolder, true) ?: $locator->findResource($securityFolder, true, true);
$filename = "{$securityFolder}/{$securityFile}";
$security_file = CompiledYamlFile::instance($filename);
$security_content = (array)$security_file->content();

View File

@ -1261,7 +1261,7 @@ class Uri
$this->port = null;
}
if ($this->hasStandardPort()) {
if ($this->port === 0 || $this->hasStandardPort()) {
$this->port = null;
}
@ -1314,11 +1314,13 @@ class Uri
if ($parts === false) {
throw new RuntimeException('Malformed URL: ' . $url);
}
$port = (int)($parts['port'] ?? 0);
$this->scheme = $parts['scheme'] ?? null;
$this->user = $parts['user'] ?? null;
$this->password = $parts['pass'] ?? null;
$this->host = $parts['host'] ?? null;
$this->port = isset($parts['port']) ? (int)$parts['port'] : null;
$this->port = $port ?: null;
$this->path = $parts['path'] ?? '';
$this->query = $parts['query'] ?? '';
$this->fragment = $parts['fragment'] ?? null;