mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 21:49:56 +09:00
Update dependencies
This commit is contained in:
9
vendor/symfony/mime/Part/DataPart.php
vendored
9
vendor/symfony/mime/Part/DataPart.php
vendored
@@ -61,13 +61,20 @@ class DataPart extends TextPart
|
||||
$contentType = self::$mimeTypes->getMimeTypes($ext)[0] ?? 'application/octet-stream';
|
||||
}
|
||||
|
||||
if (false === is_readable($path)) {
|
||||
if ((is_file($path) && !is_readable($path)) || is_dir($path)) {
|
||||
throw new InvalidArgumentException(sprintf('Path "%s" is not readable.', $path));
|
||||
}
|
||||
|
||||
if (false === $handle = @fopen($path, 'r', false)) {
|
||||
throw new InvalidArgumentException(sprintf('Unable to open path "%s".', $path));
|
||||
}
|
||||
|
||||
if (!is_file($path)) {
|
||||
$cache = fopen('php://temp', 'r+');
|
||||
stream_copy_to_stream($handle, $cache);
|
||||
$handle = $cache;
|
||||
}
|
||||
|
||||
$p = new self($handle, $name ?: basename($path), $contentType);
|
||||
$p->handle = $handle;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user