mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Fix incorrect return type when HTTP::download() cannot write to target file or parent directory
This commit is contained in:
parent
087f5a2265
commit
a1ae74837f
1 changed files with 5 additions and 1 deletions
|
|
@ -91,7 +91,11 @@ class HTTP
|
|||
$target_dir = dirname($target_filename);
|
||||
if (!Storage::isDirectory($target_dir) && !Storage::createDirectory($target_dir))
|
||||
{
|
||||
return false;
|
||||
return new Helpers\HTTPHelper(new Exception('Cannot create directory: ' . $target_dir));
|
||||
}
|
||||
if (!Storage::isWritable($target_dir) && (!Storage::exists($target_filename) || !Storage::isWritable($target_filename)))
|
||||
{
|
||||
return new Helpers\HTTPHelper(new Exception('No permission to write file: ' . $target_filename));
|
||||
}
|
||||
|
||||
// Pass to request() with appropriate settings for the filename.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue