type fixes

This commit is contained in:
Robin Appelman 2021-03-09 18:10:27 +01:00
commit 7cb4e41f8a
7 changed files with 32 additions and 7 deletions

View file

@ -316,8 +316,12 @@ class NativeShare extends AbstractShare {
* @return mixed the attribute value
*/
public function setAttribute(string $path, string $attribute, $value) {
if ($attribute === 'system.dos_attr.mode' and is_int($value)) {
$value = '0x' . dechex($value);
if (is_int($value)) {
if ($attribute === 'system.dos_attr.mode') {
$value = '0x' . dechex($value);
} else {
throw new \InvalidArgumentException("Invalid value for attribute");
}
}
return $this->getState()->setxattr($this->buildUrl($path), $attribute, $value);