Merge pull request #106 from Rid/patch-1

Fix mistaking socket files for directories
This commit is contained in:
Robin Appelman 2021-10-28 16:42:56 +00:00 committed by GitHub
commit a9a5698cac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,7 +99,7 @@ class NativeFileInfo implements IFileInfo {
public function isDirectory(): bool { public function isDirectory(): bool {
$mode = $this->getMode(); $mode = $this->getMode();
if ($mode > 0x1000) { if ($mode > 0x1000) {
return (bool)($mode & 0x4000); // 0x4000: unix directory flag return ($mode & 0x4000 && !($mode & 0x8000)); // 0x4000: unix directory flag shares bits with 0xC000: socket
} else { } else {
return (bool)($mode & IFileInfo::MODE_DIRECTORY); return (bool)($mode & IFileInfo::MODE_DIRECTORY);
} }