Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Improved permission detection when using ftp backend #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/src/plugins/access.ftp/class.ftpAccessDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,18 @@ public function isWriteable($path, $type="dir")
if ($type == "dir" && ($dir == "" || $dir == "/" || $dir == "\\")) { // ROOT, WE ARE NOT SURE TO BE ABLE TO READ THE PARENT
return true;
} else {
if (strtoupper(substr(PHP_OS, 0, 3)) === "WIN") {
return is_writable($path);
} else {
if (extension_loaded("posix")) {
posix_access($path, POSIX_W_OK);
return posix_get_last_error();
} else {
return is_writable($path);
}
}
return is_writable($path);
}

}

public function deldir($location)
Expand Down