diff --git a/e107_handlers/resize_handler.php b/e107_handlers/resize_handler.php index 0448d4d48..d550939ec 100644 --- a/e107_handlers/resize_handler.php +++ b/e107_handlers/resize_handler.php @@ -111,7 +111,7 @@ function resize_image($source_file, $destination_file, $type = "upload", $model { if (($result = mimeFromFilename($source_file)) === FALSE) { return FALSE; } header($result); - if (@readfile($source_file) === FALSE) { return FALSE; } + if (e_shims::readfile($source_file) === FALSE) { return FALSE; } } else { diff --git a/thumb.php b/thumb.php index b863bce59..07201ad98 100755 --- a/thumb.php +++ b/thumb.php @@ -156,6 +156,7 @@ class e_thumbpage @require($tmp.DIRECTORY_SEPARATOR.'core_functions.php'); //e107 class @require($tmp.DIRECTORY_SEPARATOR.'e107_class.php'); + e107::autoload_register(array('e107', 'autoload')); $e107_paths = compact( 'ADMIN_DIRECTORY', @@ -324,11 +325,12 @@ class e_thumbpage $fname = e107::getParser()->thumbCacheFile($this->_src_path, $options); - if(($this->_cache === true) && is_file(e_CACHE_IMAGE.$fname) && is_readable(e_CACHE_IMAGE.$fname) && ($this->_debug !== true)) + $cache_filename = e_CACHE_IMAGE . $fname; + if(($this->_cache === true) && is_file($cache_filename) && is_readable($cache_filename) && ($this->_debug !== true)) { - $thumbnfo['lmodified'] = filemtime(e_CACHE_IMAGE.$fname); - $thumbnfo['md5s'] = md5_file(e_CACHE_IMAGE.$fname); - $thumbnfo['fsize'] = filesize(e_CACHE_IMAGE.$fname); + $thumbnfo['lmodified'] = filemtime($cache_filename); + $thumbnfo['md5s'] = md5_file($cache_filename); + $thumbnfo['fsize'] = filesize($cache_filename); // Send required headers if($this->_debug !== true) @@ -349,9 +351,7 @@ class e_thumbpage // Send required headers //$this->sendHeaders($thumbnfo); - - - @readfile(e_CACHE_IMAGE.$fname); + e_shims::readfile($cache_filename); //$bench->end()->logResult('thumb.php', $_GET['src'].' - retrieve cache'); exit; @@ -443,7 +443,7 @@ class e_thumbpage //exit; // set cache - $thumb->save(e_CACHE_IMAGE.$fname); + $thumb->save($cache_filename);