From ea41c8aa1951216b6a9ccc99832d69d2b41c5ead Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 26 Feb 2014 18:31:02 +0200 Subject: Don't use error suppression on realpath() + style adjustments --- system/libraries/Image_lib.php | 4 ++-- system/libraries/Upload.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index db45a80fc..ac3db416d 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -493,9 +493,9 @@ class CI_Image_lib { * Either way, we'll try use realpath to generate the * full server path in order to more reliably read it. */ - if (function_exists('realpath') && @realpath($this->source_image) !== FALSE) + if (($full_source_path = realpath($this->source_image)) !== FALSE) { - $full_source_path = str_replace('\\', '/', realpath($this->source_image)); + $full_source_path = str_replace('\\', '/', $full_source_path); } else { diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 583a97693..62cfb28c0 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -967,7 +967,7 @@ class CI_Upload { return FALSE; } - if (@realpath($this->upload_path) !== FALSE) + if (realpath($this->upload_path) !== FALSE) { $this->upload_path = str_replace('\\', '/', realpath($this->upload_path)); } -- cgit v1.2.3-24-g4f1b