forked from Wavyzz/dolibarr
FIX: Update swiftmailer librairies
This commit is contained in:
@@ -16,18 +16,14 @@
|
||||
class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
{
|
||||
/** Recognized MIME types */
|
||||
private $mimeTypes = array();
|
||||
private $mimeTypes = [];
|
||||
|
||||
/**
|
||||
* Create a new Attachment with $headers, $encoder and $cache.
|
||||
*
|
||||
* @param Swift_Mime_SimpleHeaderSet $headers
|
||||
* @param Swift_Mime_ContentEncoder $encoder
|
||||
* @param Swift_KeyCache $cache
|
||||
* @param Swift_IdGenerator $idGenerator
|
||||
* @param array $mimeTypes
|
||||
* @param array $mimeTypes
|
||||
*/
|
||||
public function __construct(Swift_Mime_SimpleHeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator, $mimeTypes = array())
|
||||
public function __construct(Swift_Mime_SimpleHeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator, $mimeTypes = [])
|
||||
{
|
||||
parent::__construct($headers, $encoder, $cache, $idGenerator);
|
||||
$this->setDisposition('attachment');
|
||||
@@ -127,8 +123,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
/**
|
||||
* Set the file that this attachment is for.
|
||||
*
|
||||
* @param Swift_FileStream $file
|
||||
* @param string $contentType optional
|
||||
* @param string $contentType optional
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@@ -139,7 +134,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
if (!isset($contentType)) {
|
||||
$extension = strtolower(substr($file->getPath(), strrpos($file->getPath(), '.') + 1));
|
||||
|
||||
if (array_key_exists($extension, $this->mimeTypes)) {
|
||||
if (\array_key_exists($extension, $this->mimeTypes)) {
|
||||
$this->setContentType($this->mimeTypes[$extension]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user