Add method visibility declarations and optimize display_errors() method in Image_lib, Trackback and Upload libraries
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 66e91c5..ab97d1a 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -934,13 +934,7 @@
*/
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 @@
// END Upload Class
/* End of file Upload.php */
-/* Location: ./system/libraries/Upload.php */
\ No newline at end of file
+/* Location: ./system/libraries/Upload.php */