Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Fix tests for setupchecks
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Nov 20, 2023
commit ad372869bc803c3540fd8657c4fcb643d3db5b08
4 changes: 2 additions & 2 deletions apps/settings/lib/SetupChecks/BruteForceThrottler.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public function run(): SetupResult {
}
} elseif ($this->throttler->showBruteforceWarning($address)) {
return SetupResult::error(
$this->l10n->t('Your remote address was identified as "%s" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly.', $address),
$this->l10n->t('Your remote address was identified as "%s" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly.', [$address]),
$this->urlGenerator->linkToDocs('admin-reverse-proxy')
);
} else {
return SetupResult::success(
$this->l10n->t('Your remote address "%s" is not bruteforce throttled.', $address)
$this->l10n->t('Your remote address "%s" is not bruteforce throttled.', [$address])
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/SetupChecks/ForwardedForHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function run(): SetupResult {
if (\in_array($remoteAddress, $trustedProxies, true) && ($remoteAddress !== '127.0.0.1')) {
if ($remoteAddress !== $detectedRemoteAddress) {
/* Remote address was successfuly fixed */
return SetupResult::success($this->l10n->t('Your IP address was resolved as %s', $detectedRemoteAddress));
return SetupResult::success($this->l10n->t('Your IP address was resolved as %s', [$detectedRemoteAddress]));
} else {
return SetupResult::warning(
$this->l10n->t('The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud.'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function testForwardedHostPresentButTrustedProxiesEmpty(): void {
->willReturn('1.1.1.1');

$this->assertEquals(
SetupResult::WARNING,
SetupResult::ERROR,
$this->check->run()->getSeverity()
);
}
Expand Down