diff options
author | Pavel Kryl <pavel@kryl.eu> | 2022-01-13 18:51:24 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-01-29 09:59:35 +0000 |
commit | 55991f93c2fae9a31f0a43b4d6a078ffb9cef5e1 (patch) | |
tree | e678f4e6bfe7b02ecd7d8f5a5d9f8b9f4aa6086d /lib | |
parent | 15d3515d6d16cd190491c5d4d5bcd8b4b12f0e77 (diff) | |
download | nextcloud-server-55991f93c2fae9a31f0a43b4d6a078ffb9cef5e1.tar.gz nextcloud-server-55991f93c2fae9a31f0a43b4d6a078ffb9cef5e1.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')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index fdc475bd165..db568717b39 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -298,7 +298,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]; } @@ -626,14 +626,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; } /** @@ -643,7 +641,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'); } |