From 4eea9895e8ced75a1099c56215c09773de94b92c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Dec 2011 12:05:41 +0200 Subject: Add method visibility declarations and optimize display_errors() method in Image_lib, Trackback and Upload libraries --- system/libraries/Upload.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'system/libraries/Upload.php') diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 66e91c5b6..ab97d1a0f 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -934,13 +934,7 @@ class CI_Upload { */ public function display_errors($open = '

', $close = '

') { - $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 */ -- cgit v1.2.3-24-g4f1b