Skip to content

Commit

Permalink
Workflow fix + missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
dlundgren committed Oct 30, 2024
1 parent a8ae064 commit 9305a55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
ports:
- "8080:8080"
volumes:
- "${{ github_workspace }}:/var/www/html"
- "${{ github.workspace }}:/var/www/html"
env:
# serversideup/php
NGINX_WEBROOT: "/var/www/html/web"
Expand Down
9 changes: 9 additions & 0 deletions src/Action/Api/Scope/Box/UploadAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ protected function perform(ServerRequestInterface $request, Box $box, $params):
*/
protected function validate(ServerRequestInterface $request)
{
if (!is_writable($this->uploadPath)) {
if (!is_writable(dirname($this->uploadPath))) {
return new Response\InternalServerError("Unable to write to disk: {$this->uploadPath}");
}
else {
mkdir($this->uploadPath);
}
}

/**
* The route controls these params, and they are validated so safe
*
Expand Down

0 comments on commit 9305a55

Please sign in to comment.