summaryrefslogtreecommitdiff
path: root/lib/exe/fetch.php
diff options
context:
space:
mode:
authorGerry Weissbach <gerry.w@gammaproduction.de>2008-07-27 20:02:06 +0200
committerGerry Weissbach <gerry.w@gammaproduction.de>2008-07-27 20:02:06 +0200
commite42176e664586f1c13c36e18fead54a6776cb387 (patch)
tree8f7b3fcec63de6ee34fc8a245516c03ec68e0eb8 /lib/exe/fetch.php
parenta8f2bc0521440f1745a9c96549f50741e75bc042 (diff)
downloadrpg-e42176e664586f1c13c36e18fead54a6776cb387.tar.gz
rpg-e42176e664586f1c13c36e18fead54a6776cb387.tar.bz2
Avoid div by zero in get_cropped() FS#1453
darcs-hash:20080727180206-0d72e-28f6206ebe4f6c36f835c50f46d9cbe220ab6177.gz
Diffstat (limited to 'lib/exe/fetch.php')
-rw-r--r--lib/exe/fetch.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index c39e21173..9bfb5d1d4 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -245,7 +245,8 @@ function get_cropped($file, $ext, $w, $h=0){
global $conf;
if(!$h) $h = $w;
- $info = getimagesize($file); //get original size
+ $info = @getimagesize($file); //get original size
+ if($info == false) return $file; // that's no image - it's a spaceship!
// calculate crop size
$fr = $info[0]/$info[1];