From 10eb14d37a4399f7ed4dfa212feef07e2041f889 Mon Sep 17 00:00:00 2001 From: trit Date: Wed, 23 Nov 2011 15:48:21 -0500 Subject: Changed attachment definition to allow for blank disposition defaulting to attachment - should make things easier for the user who uses a custom name --- system/libraries/Email.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'system') 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]; -- cgit v1.2.3-24-g4f1b