Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixing bug #6914: Config Param 'overwritecondaddr' not working
- just ignoring/removing extra parameter 'protocol' as suggested by
  blizzz

Signed-off-by: Pavel Kryl <[email protected]>
  • Loading branch information
pavelkryl authored and backportbot[bot] committed Jan 29, 2024
commit 5d4173d6127293133bfc19ee6d15c07d333efe0c
6 changes: 2 additions & 4 deletions lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function __unset($id) {
* @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];
}
Expand Down Expand Up @@ -626,14 +626,12 @@ public function getRemoteAddress(): string {

/**
* Check overwrite condition
* @param string $type
* @return bool
*/
private function isOverwriteCondition(string $type = ''): bool {
$regex = '/' . $this->config->getSystemValue('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;
}

/**
Expand Down