Skip to content

Commit

Permalink
Merge pull request #30858 from nextcloud/fix/ajax-list-dir-content-on…
Browse files Browse the repository at this point in the history
…-file

Return 404 when AJAX tries to list dir content but file given
  • Loading branch information
artonge authored Jan 27, 2022
2 parents 3500d8b + ba1338e commit 34f425c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/files/ajax/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

try {
$dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
if (!$dirInfo || !$dirInfo->getType() === 'dir') {
if (!$dirInfo || $dirInfo->getType() !== 'dir') {
http_response_code(404);
exit();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ public static function normalizePath($path, $stripTrailingSlash = true, $isAbsol
* @param string $path
* @param boolean $includeMountPoints whether to add mountpoint sizes,
* defaults to true
* @return \OC\Files\FileInfo|bool False if file does not exist
* @return \OC\Files\FileInfo|false False if file does not exist
*/
public static function getFileInfo($path, $includeMountPoints = true) {
return self::$defaultInstance->getFileInfo($path, $includeMountPoints);
Expand Down

0 comments on commit 34f425c

Please sign in to comment.