diff options
-rw-r--r-- | application/config/config.php | 3 | ||||
-rwxr-xr-x | system/helpers/url_helper.php | 2 | ||||
-rw-r--r-- | system/libraries/Email.php | 11 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 7 | ||||
-rw-r--r-- | user_guide_src/source/helpers/string_helper.rst | 2 | ||||
-rw-r--r-- | user_guide_src/source/libraries/email.rst | 6 |
6 files changed, 20 insertions, 11 deletions
diff --git a/application/config/config.php b/application/config/config.php index 808cc33bd..063c3d5d1 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -253,6 +253,9 @@ $config['cache_path'] = ''; | | If you use the Encryption class or the Session class you | MUST set an encryption key. See the user guide for info. +| +| http://codeigniter.com/user_guide/libraries/encryption.html +| http://codeigniter.com/user_guide/libraries/sessions.html | */ $config['encryption_key'] = ''; diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 5d907d00e..5d9afe457 100755 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -393,7 +393,7 @@ if ( ! function_exists('auto_link')) { if ($type != 'email') { - if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)) + if (preg_match_all("#(^|\s|\(|\b)((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)) { $pop = ($popup == TRUE) ? " target=\"_blank\" " : ""; diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 7bde4c4fd..631b62e86 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -418,11 +418,11 @@ class CI_Email { * @param string * @return void */ - public function attach($filename, $disposition = 'attachment') + public function attach($filename, $disposition = '', $newname = NULL) { - $this->_attach_name[] = $filename; + $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 + $this->_attach_disp[] = empty($disposition) ? 'attachment' : $disposition; // Can also be 'inline' Not sure if it matters return $this; } @@ -1151,8 +1151,9 @@ class CI_Email { for ($i=0; $i < count($this->_attach_name); $i++) { - $filename = $this->_attach_name[$i]; - $basename = basename($filename); + $filename = $this->_attach_name[$i][0]; + $basename = ( is_null($this->_attach_name[$i][1]) ? basename($filename) : $this->_attach_name[$i][1] ); + $ctype = $this->_attach_type[$i]; if ( ! file_exists($filename)) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index b9ca39cee..979755c06 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -35,8 +35,8 @@ Release Date: Not Released - Database - - Added new :doc:`Active Record <database/active_record>` methods that return - the SQL string of queries without executing them: get_compiled_select(), + - Added new :doc:`Active Record <database/active_record>` methods that return + the SQL string of queries without executing them: get_compiled_select(), get_compiled_insert(), get_compiled_update(), get_compiled_delete(). - Libraries @@ -44,6 +44,7 @@ Release Date: Not Released - Added max_filename_increment config setting for Upload library. - CI_Loader::_ci_autoloader() is now a protected method. - Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the :doc:`Form Validation library <libraries/form_validation>`. + - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname) - Core @@ -58,7 +59,7 @@ Bug fixes for 3.0 - Fixed a bug (#181) where a mis-spelling was in the form validation language file. - Fixed a bug (#159, #163) that mishandled Active Record nested transactions because _trans_depth was not getting incremented. - +- Bug #419 - auto_link() now recognizes URLs that come after a word boundary. Version 2.1.0 ============= diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index b8a69e036..dc70e461a 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -58,7 +58,7 @@ Usage example echo increment_string('file', '_'); // "file_1" echo increment_string('file', '-', 2); // "file-2" - echo increment_string('file-4'); // "file-5" + echo increment_string('file_4'); // "file_5" alternator() ============ diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index 759899242..27b704dae 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,7 +228,11 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); - $this->email->send(); +If you'd like to change the disposition or add a custom file name, you can use the second and third paramaters. To use the default disposition (attachment), leave the second parameter blank. Here's an example:: + + $this->email->attach('/path/to/photo1.jpg', 'inline'); + $this->email->attach('/path/to/photo1.jpg', '', 'birthday.jpg'); + $this->email->print_debugger() ------------------------------- |