summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-08-10 16:06:37 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-08-10 16:06:37 +0200
commit0aaf42b45f7b56bb1d5e99e17ac3045348064cdd (patch)
tree8a3ecc8d3c5a559ad3f88d99b3bb6cfae052db5a /system/libraries/Email.php
parent77cc0281479b9ccecc9f7bc1386846a1ccf5f94f (diff)
Fixed a bug where Email library attachments with a . in the name would using invalid MIME-types.
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r--system/libraries/Email.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 9b3bc75e1..fb9a75049 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -395,7 +395,7 @@ class CI_Email {
public function attach($filename, $disposition = 'attachment')
{
$this->_attach_name[] = $filename;
- $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename))));
+ $this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION));
$this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters
return $this;
}