diff options
author | Eric Barnes <eric@ericlbarnes.com> | 2011-12-23 14:21:30 +0100 |
---|---|---|
committer | Eric Barnes <eric@ericlbarnes.com> | 2011-12-23 14:21:30 +0100 |
commit | 5c208fbe6f22651f4bc817a94dae819bbdf3406a (patch) | |
tree | e338d80af67bd20a3159dc206a75fd3fd530e98c /system/libraries/Upload.php | |
parent | a9bc5af2d94d1d7765709134df4af12813e62a84 (diff) | |
parent | 3a45957a30ff908445b2772efac8fdb65b64e6cd (diff) |
Merge pull request #796 from narfbg/develop
Optimize display_errors() in Image_lib, Trackback and Upload libraries
Diffstat (limited to 'system/libraries/Upload.php')
-rw-r--r-- | system/libraries/Upload.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 66e91c5b6..826bcceb8 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -5,9 +5,9 @@ * An open source application development framework for PHP 5.1.6 or newer * * NOTICE OF LICENSE - * + * * Licensed under the Open Software License version 3.0 - * + * * This source file is subject to the Open Software License (OSL 3.0) that is * bundled with this package in the files license.txt / license.rst. It is * also available through the world wide web at this URL: @@ -934,13 +934,7 @@ class CI_Upload { */ public function display_errors($open = '<p>', $close = '</p>') { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; + return (count($this->error_msg) > 0) ? $open . implode($close . $open, $this->error_msg) . $close : ''; } // -------------------------------------------------------------------- @@ -1086,4 +1080,4 @@ class CI_Upload { // END Upload Class /* End of file Upload.php */ -/* Location: ./system/libraries/Upload.php */
\ No newline at end of file +/* Location: ./system/libraries/Upload.php */ |