summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/ajax/publicpreview.php2
-rw-r--r--apps/files_sharing/l10n/az.js1
-rw-r--r--apps/files_sharing/l10n/az.json1
-rw-r--r--apps/files_sharing/public.php8
4 files changed, 10 insertions, 2 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);
diff --git a/apps/files_sharing/l10n/az.js b/apps/files_sharing/l10n/az.js
index 44a48208caf..3f67d4248e0 100644
--- a/apps/files_sharing/l10n/az.js
+++ b/apps/files_sharing/l10n/az.js
@@ -20,6 +20,7 @@ OC.L10N.register(
"You shared %1$s via link" : "Siz yayımladınız %1$s link ilə",
"Shares" : "Yayımlanmalar",
"Password" : "Şifrə",
+ "No entries found in this folder" : "Bu qovluqda heç bir verilən tapılmadı",
"Name" : "Ad",
"Download" : "Yüklə"
},
diff --git a/apps/files_sharing/l10n/az.json b/apps/files_sharing/l10n/az.json
index a9c0bca43f1..ae7f139cbc1 100644
--- a/apps/files_sharing/l10n/az.json
+++ b/apps/files_sharing/l10n/az.json
@@ -18,6 +18,7 @@
"You shared %1$s via link" : "Siz yayımladınız %1$s link ilə",
"Shares" : "Yayımlanmalar",
"Password" : "Şifrə",
+ "No entries found in this folder" : "Bu qovluqda heç bir verilən tapılmadı",
"Name" : "Ad",
"Download" : "Yüklə"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 028c6da12f9..ebc5b7bda45 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -25,4 +25,10 @@ $urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig());
$token = isset($_GET['t']) ? $_GET['t'] : '';
$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare';
-OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
+if($token !== '') {
+ OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
+} else {
+ header('HTTP/1.0 404 Not Found');
+ $tmpl = new OCP\Template('', '404', 'guest');
+ print_unescaped($tmpl->fetchPage());
+}