Merge pull request #272 from nao-pon/fix_attr

fix attr()
This commit is contained in:
Dmitry (dio) Levashov
2012-06-01 23:56:07 -07:00
+4 -4
View File
@@ -1963,7 +1963,7 @@ abstract class elFinderVolumeDriver {
* @return bool
* @author Dmitry (dio) Levashov
**/
protected function attr($path, $name, $val=false) {
protected function attr($path, $name, $val=null) {
if (!isset($this->defaults[$name])) {
return false;
}
@@ -1994,7 +1994,7 @@ abstract class elFinderVolumeDriver {
}
}
return $perm === null ? $this->defaults[$name] : !!$perm;
return $perm === null ? (is_null($val)? $this->defaults[$name] : $val) : !!$perm;
}
/**
@@ -2060,8 +2060,8 @@ abstract class elFinderVolumeDriver {
$stat['size'] = 'unknown';
}
$stat['read'] = intval($this->attr($path, 'read', isset($stat['read']) ? !!$stat['read'] : false));
$stat['write'] = intval($this->attr($path, 'write', isset($stat['write']) ? !!$stat['write'] : false));
$stat['read'] = intval($this->attr($path, 'read', isset($stat['read']) ? !!$stat['read'] : null));
$stat['write'] = intval($this->attr($path, 'write', isset($stat['write']) ? !!$stat['write'] : null));
if ($root) {
$stat['locked'] = 1;
} elseif ($this->attr($path, 'locked', !empty($stat['locked']))) {