diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2024-01-30 16:33:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 16:33:37 +0100 |
commit | 9ec107ad253c245a401c375489fb1eb7f07ac152 (patch) | |
tree | 4ef62f5f56536418d503bb933ad3f8d4d9fc7720 /lib | |
parent | 5147fcb497d7a78ec2d421d4d681f8e8ba6be153 (diff) | |
parent | 6490e50bb9ce4e3e5525b2fc1fbf30b4893d90d0 (diff) | |
download | nextcloud-server-9ec107ad253c245a401c375489fb1eb7f07ac152.tar.gz nextcloud-server-9ec107ad253c245a401c375489fb1eb7f07ac152.zip |
Merge pull request #43182 from nextcloud/backport/42930/stable27
[stable27] Fix: config param 'overwritecondaddr' not working
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 9b314449721..f23993dbaf4 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -633,14 +633,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; } /** @@ -650,7 +648,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'); } |