summaryrefslogtreecommitdiff
path: root/lib/exe/fetch.php
diff options
context:
space:
mode:
authorgweissbach <gweissbach@inetsoftware.de>2008-08-05 15:23:09 +0200
committergweissbach <gweissbach@inetsoftware.de>2008-08-05 15:23:09 +0200
commit09a5b61f4b388f9824bb5e1bed7ec6cbe3619ff7 (patch)
treeaef25f86d03d16f2465cd6a6b6c7014071c8b597 /lib/exe/fetch.php
parent3a50618c0d0d03fe5cbf1d782868e84b873f2e89 (diff)
downloadrpg-09a5b61f4b388f9824bb5e1bed7ec6cbe3619ff7.tar.gz
rpg-09a5b61f4b388f9824bb5e1bed7ec6cbe3619ff7.tar.bz2
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
Diffstat (limited to 'lib/exe/fetch.php')
-rw-r--r--lib/exe/fetch.php6
1 files changed, 4 insertions, 2 deletions
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