From ba1338e6800d20311155be5f3a5d8c5738e88a62 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 26 Jan 2022 15:28:48 +0100 Subject: 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 --- apps/files/ajax/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files') 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(); } -- cgit v1.2.3