mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
make is-directory check more robust, by checking for PHP's directory-mode / Sqlfs::DIR_MODE too, not only for mime-type which is set eg. by stylite.links to "egs/$app"
This commit is contained in:
parent
abf87b63c9
commit
86823a7e8c
@ -1066,11 +1066,12 @@ class StreamWrapper extends Api\Db\Pdo implements Vfs\StreamWrapperIface
|
|||||||
$path = Vfs::parse_url($url,PHP_URL_PATH);
|
$path = Vfs::parse_url($url,PHP_URL_PATH);
|
||||||
|
|
||||||
if (!($stat = $this->url_stat($url,0)) || // dir not found
|
if (!($stat = $this->url_stat($url,0)) || // dir not found
|
||||||
$stat['mime'] != self::DIR_MIME_TYPE || // no dir
|
!($stat['mode'] & self::MODE_DIR) && $stat['mime'] != self::DIR_MIME_TYPE || // no dir
|
||||||
!Vfs::check_access($url,Vfs::EXECUTABLE|Vfs::READABLE,$stat)) // no access
|
!Vfs::check_access($url,Vfs::EXECUTABLE|Vfs::READABLE,$stat)) // no access
|
||||||
{
|
{
|
||||||
self::_remove_password($url);
|
self::_remove_password($url);
|
||||||
$msg = $stat['mime'] != self::DIR_MIME_TYPE ? "$url is no directory" : 'permission denied';
|
$msg = !($stat['mode'] & self::MODE_DIR) && $stat['mime'] != self::DIR_MIME_TYPE ?
|
||||||
|
"$url is no directory" : 'permission denied';
|
||||||
if (self::LOG_LEVEL) error_log(__METHOD__."('$url',$options) $msg!");
|
if (self::LOG_LEVEL) error_log(__METHOD__."('$url',$options) $msg!");
|
||||||
$this->opened_dir = null;
|
$this->opened_dir = null;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user