Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaIng <micha@dietpi.com>2022-01-26 17:28:48 +0300
committerMichaIng <micha@dietpi.com>2022-01-26 18:11:50 +0300
commitba1338e6800d20311155be5f3a5d8c5738e88a62 (patch)
treea15fa99eb1bb3a97086d17c29ab7bf37c5d6da6d /apps/files
parenta145edd00db95135bee6f584e21301267fb5ac16 (diff)
Return 404 when AJAX tries to list dir content but file given
Due to a code mistake, the expected 404 return when AJAX tries to list a directory content with a non-directory file path given, does not happen. It instead fails with another exception. This commit restores the original intention to return 404 in the first place when passing a non-directory path with the "dir" parameter. Signed-off-by: MichaIng <micha@dietpi.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/list.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index e43e5dd08e8..8a48d4fbe1f 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') {
+ if (!$dirInfo || $dirInfo->getType() !== 'dir') {
http_response_code(404);
exit();
}