summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authortrit <tritrei@gmail.com>2011-11-23 21:48:21 +0100
committertrit <tritrei@gmail.com>2011-11-23 21:48:21 +0100
commit10eb14d37a4399f7ed4dfa212feef07e2041f889 (patch)
tree1b4072f3ed4c714c8c5a4d69bf43142117366ec9 /system/libraries
parent7f42519fd156a541bdb3517b517287f3352b5e49 (diff)
Changed attachment definition to allow for blank disposition defaulting to attachment - should make things easier for the user who uses a custom name
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Email.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index e012545d9..a24ce7440 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -418,8 +418,10 @@ class CI_Email {
* @param string
* @return void
*/
- public function attach($filename, $disposition = 'attachment', $newname = NULL)
+ public function attach($filename, $disposition = '', $newname = NULL)
{
+ if(empty($disposition))
+ $disposition = 'attachment';
$this->_attach_name[] = array($filename, $newname);
$this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION));
$this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters
@@ -1152,7 +1154,7 @@ class CI_Email {
for ($i=0; $i < count($this->_attach_name); $i++)
{
$filename = $this->_attach_name[$i][0];
- $basename = is_null($this->_attach_name[$i][1]) ? basename($filename) : $this->_attach_name[$i][1];
+ $basename = ( is_null($this->_attach_name[$i][1]) ? basename($filename) : $this->_attach_name[$i][1] );
$ctype = $this->_attach_type[$i];