aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorPavel Kryl <pavel@kryl.eu>2022-01-13 18:51:24 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-01-29 09:58:56 +0000
commit21625f0d66bc3bfa1d5dc00c9ee9b4a571ed9701 (patch)
treefd8c3027f08b86a0b6548d76b0bcce7d89dec922 /lib/private/AppFramework
parenta35ba912b927b626db78ee529d00cefce8d739c1 (diff)
downloadnextcloud-server-21625f0d66bc3bfa1d5dc00c9ee9b4a571ed9701.tar.gz
nextcloud-server-21625f0d66bc3bfa1d5dc00c9ee9b4a571ed9701.zip
fixing bug #6914: Config Param 'overwritecondaddr' not working
- just ignoring/removing extra parameter 'protocol' as suggested by blizzz Signed-off-by: Pavel Kryl <pavel@kryl.eu>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Http/Request.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index b09737a6fc6..cd1f5109749 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -294,7 +294,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @return string
*/
public function getHeader(string $name): string {
- $name = strtoupper(str_replace('-', '_', $name));
+ $name = strtoupper(str_replace('-', '_',$name));
if (isset($this->server['HTTP_' . $name])) {
return $this->server['HTTP_' . $name];
}
@@ -622,14 +622,12 @@ class Request implements \ArrayAccess, \Countable, IRequest {
/**
* Check overwrite condition
- * @param string $type
* @return bool
*/
- private function isOverwriteCondition(string $type = ''): bool {
+ private function isOverwriteCondition(): bool {
$regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/';
$remoteAddr = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : '';
- return $regex === '//' || preg_match($regex, $remoteAddr) === 1
- || $type !== 'protocol';
+ return $regex === '//' || preg_match($regex, $remoteAddr) === 1;
}
/**
@@ -639,7 +637,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
*/
public function getServerProtocol(): string {
if ($this->config->getSystemValueString('overwriteprotocol') !== ''
- && $this->isOverwriteCondition('protocol')) {
+ && $this->isOverwriteCondition()) {
return $this->config->getSystemValueString('overwriteprotocol');
}