From 09a5b61f4b388f9824bb5e1bed7ec6cbe3619ff7 Mon Sep 17 00:00:00 2001 From: gweissbach Date: Tue, 5 Aug 2008 15:23:09 +0200 Subject: fetch.php file not existing and devision by zero If the cache file does not exist after it should have been generated via an action plugin or via resizing filemtime fails with a file not found. This has to be fixed by @filemtime. Another fix is the check for the $INFO before resizing an image in get_resized. get_croped has already been fixed darcs-hash:20080805132309-f4337-41698af01cf1f3632bd68e1e10724bdffc7c58a3.gz --- lib/exe/fetch.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/exe') diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php index 9bfb5d1d4..091fd501b 100644 --- a/lib/exe/fetch.php +++ b/lib/exe/fetch.php @@ -100,7 +100,7 @@ */ function sendFile($file,$mime,$cache){ global $conf; - $fmtime = filemtime($file); + $fmtime = @filemtime($file); // send headers header("Content-Type: $mime"); // smart http caching headers @@ -212,7 +212,9 @@ function http_rangeRequest($size){ function get_resized($file, $ext, $w, $h=0){ global $conf; - $info = getimagesize($file); + $info = @getimagesize($file); //get original size + if($info == false) return $file; // that's no image - it's a spaceship! + if(!$h) $h = round(($w * $info[1]) / $info[0]); // we wont scale up to infinity -- cgit v1.2.3