mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-06 06:53:55 +09:00
Update dependencies
This commit is contained in:
20
vendor/symfony/mime/Email.php
vendored
20
vendor/symfony/mime/Email.php
vendored
@@ -272,12 +272,16 @@ class Email extends Message
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource|string $body
|
||||
* @param resource|string|null $body
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function text($body, string $charset = 'utf-8')
|
||||
{
|
||||
if (null !== $body && !\is_string($body) && !\is_resource($body)) {
|
||||
throw new \TypeError(sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body)));
|
||||
}
|
||||
|
||||
$this->text = $body;
|
||||
$this->textCharset = $charset;
|
||||
|
||||
@@ -304,6 +308,10 @@ class Email extends Message
|
||||
*/
|
||||
public function html($body, string $charset = 'utf-8')
|
||||
{
|
||||
if (null !== $body && !\is_string($body) && !\is_resource($body)) {
|
||||
throw new \TypeError(sprintf('The body must be a string, a resource or null (got "%s").', get_debug_type($body)));
|
||||
}
|
||||
|
||||
$this->html = $body;
|
||||
$this->htmlCharset = $charset;
|
||||
|
||||
@@ -330,6 +338,10 @@ class Email extends Message
|
||||
*/
|
||||
public function attach($body, string $name = null, string $contentType = null)
|
||||
{
|
||||
if (!\is_string($body) && !\is_resource($body)) {
|
||||
throw new \TypeError(sprintf('The body must be a string or a resource (got "%s").', get_debug_type($body)));
|
||||
}
|
||||
|
||||
$this->attachments[] = ['body' => $body, 'name' => $name, 'content-type' => $contentType, 'inline' => false];
|
||||
|
||||
return $this;
|
||||
@@ -352,6 +364,10 @@ class Email extends Message
|
||||
*/
|
||||
public function embed($body, string $name = null, string $contentType = null)
|
||||
{
|
||||
if (!\is_string($body) && !\is_resource($body)) {
|
||||
throw new \TypeError(sprintf('The body must be a string or a resource (got "%s").', get_debug_type($body)));
|
||||
}
|
||||
|
||||
$this->attachments[] = ['body' => $body, 'name' => $name, 'content-type' => $contentType, 'inline' => true];
|
||||
|
||||
return $this;
|
||||
@@ -463,7 +479,7 @@ class Email extends Message
|
||||
$names = [];
|
||||
$htmlPart = null;
|
||||
$html = $this->html;
|
||||
if (null !== $this->html) {
|
||||
if (null !== $html) {
|
||||
$htmlPart = new TextPart($html, $this->htmlCharset, 'html');
|
||||
$html = $htmlPart->getBody();
|
||||
preg_match_all('(<img\s+[^>]*src\s*=\s*(?:([\'"])cid:([^"]+)\\1|cid:([^>\s]+)))i', $html, $names);
|
||||
|
||||
Reference in New Issue
Block a user