summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax/publicpreview.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-24 11:49:40 +0100
committerLukas Reschke <lukas@owncloud.com>2015-02-24 11:49:40 +0100
commit165afb004b68d0429c6e65e296a4508308929f26 (patch)
tree5166a71b8ec736dd2e27c3ac7e533d5e84e8887a /apps/files_sharing/ajax/publicpreview.php
parentda8e34cf7f31ae6b560fabdd9c59179b4e1f4f0a (diff)
downloadnextcloud-server-165afb004b68d0429c6e65e296a4508308929f26.tar.gz
nextcloud-server-165afb004b68d0429c6e65e296a4508308929f26.zip
Use getRemoteAddress which supports reverse proxies
Breaking change for 8.1 wiki (Security > Administrators): The log format for failed logins has changed and uses now the remote address and is considering reverse proxies for such scenarios when configured correctly.
Diffstat (limited to 'apps/files_sharing/ajax/publicpreview.php')
-rw-r--r--apps/files_sharing/ajax/publicpreview.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index ffb6f8d3147..1b61c08c2ac 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -68,7 +68,7 @@ if($linkedItem['item_type'] === 'folder') {
$isValid = \OC\Files\Filesystem::isValidPath($file);
if(!$isValid) {
\OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST);
- \OC_Log::write('core-preview', 'Passed filename is not valid, might be malicious (file:"' . $file . '";ip:"' . $_SERVER['REMOTE_ADDR'] . '")', \OC_Log::WARN);
+ \OC_Log::write('core-preview', 'Passed filename is not valid, might be malicious (file:"' . $file . '";ip:"' . \OC::$server->getRequest()->getRemoteAddress() . '")', \OC_Log::WARN);
exit;
}
$sharedFile = \OC\Files\Filesystem::normalizePath($file);