Skip to content

Commit

Permalink
feature(storage): Allow unlink operation on symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
taminob committed Nov 23, 2023
1 parent 5f159d4 commit 9a557bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ public function is_file($path) {
return is_file($this->getSourcePath($path));
}

public function is_link($path) {
return is_link($this->getSourcePath($path));
}

public function stat($path) {
$fullPath = $this->getSourcePath($path);
clearstatcache(true, $fullPath);
Expand Down Expand Up @@ -340,7 +344,7 @@ public function file_put_contents($path, $data) {
public function unlink($path) {
if ($this->is_dir($path)) {
return $this->rmdir($path);
} elseif ($this->is_file($path)) {
} elseif ($this->is_file($path) || $this->is_link($path)) {
return unlink($this->getSourcePath($path));
} else {
return false;
Expand Down

0 comments on commit 9a557bf

Please sign in to comment.