summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-26 10:32:50 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-06-26 16:14:15 +0200
commit79d9841bce94c0e9abf5e53c845236296a8999de (patch)
treeb676ba133dbf68ad0d64ba21bf192bdb4308294a /apps
parentd9d557a5ef31d63a8807feac1c530c36a077607f (diff)
downloadnextcloud-server-79d9841bce94c0e9abf5e53c845236296a8999de.tar.gz
nextcloud-server-79d9841bce94c0e9abf5e53c845236296a8999de.zip
Replace hardcoded status headers with calls to http_response_code()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/ajax/list.php2
-rw-r--r--apps/files_sharing/public.php7
-rw-r--r--apps/files_trashbin/ajax/list.php2
-rw-r--r--apps/files_versions/download.php2
4 files changed, 6 insertions, 7 deletions
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index c013733dbb3..588c76154a5 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -38,7 +38,7 @@ $dir = \OC\Files\Filesystem::normalizePath($dir);
try {
$dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
if (!$dirInfo || !$dirInfo->getType() === 'dir') {
- header("HTTP/1.0 404 Not Found");
+ http_response_code(404);
exit();
}
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 0ca7e8f245e..e1e4aa877b2 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -30,14 +30,13 @@ $route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare
if($token !== '') {
$protocol = \OC::$server->getRequest()->getHttpProtocol();
if ($protocol == 'HTTP/1.0') {
- $status = '302 Found';
+ http_response_code(302);
} else {
- $status = '307 Temporary Redirect';
+ http_response_code(307);
}
- header($protocol.' ' . $status);
header('Location: ' . $urlGenerator->linkToRoute($route, array('token' => $token)));
} else {
- header('HTTP/1.0 404 Not Found');
+ http_response_code(404);
$tmpl = new OCP\Template('', '404', 'guest');
print_unescaped($tmpl->fetchPage());
}
diff --git a/apps/files_trashbin/ajax/list.php b/apps/files_trashbin/ajax/list.php
index c31a33c2050..e72c063f428 100644
--- a/apps/files_trashbin/ajax/list.php
+++ b/apps/files_trashbin/ajax/list.php
@@ -34,7 +34,7 @@ $data = array();
try {
$files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir, \OCP\User::getUser(), $sortAttribute, $sortDirection);
} catch (Exception $e) {
- header("HTTP/1.0 404 Not Found");
+ http_response_code(404);
exit();
}
diff --git a/apps/files_versions/download.php b/apps/files_versions/download.php
index 77f3e9f0887..65ba245d71d 100644
--- a/apps/files_versions/download.php
+++ b/apps/files_versions/download.php
@@ -34,7 +34,7 @@ $revision=(int)$_GET['revision'];
try {
list($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($file);
} catch(\OCP\Files\NotFoundException $e) {
- header("HTTP/1.1 404 Not Found");
+ http_response_code(404);
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->assign('file', '');
$tmpl->printPage();