Images.php
authorChris <chris@roojs.com>
Fri, 12 Oct 2012 11:51:11 +0000 (19:51 +0800)
committerChris <chris@roojs.com>
Fri, 12 Oct 2012 11:51:11 +0000 (19:51 +0800)
Images.php

index 975c88f..34b8d6a 100644 (file)
@@ -81,16 +81,16 @@ class Pman_Core_Images extends Pman
             $popts = PEAR::getStaticProperty('Pman','options');
             $file = "{$popts['event_log_dir']}/{$bits[1]}.jpg";
             header ('Content-Type: image/jpeg');
-        if(isset($bits[2]) == 'download' && $bits[0] == 'events'){
-            header("Content-Disposition: attachment; filename=\"".basename($file)."\";" );
-            ob_clean();
-            flush();
-            readfile($file);
-        }else{
-            $fh = fopen($file,'r');
-            echo fread($fh,filesize($file));
-        }
-        exit;
+            if(!empty($bits[0]) && $bits[0] == 'events'){
+                header("Content-Disposition: attachment; filename=\"".basename($file)."\";" );
+                ob_clean();
+                flush();
+                readfile($file);
+            }else{
+                $fh = fopen($file,'r');
+                echo fread($fh,filesize($file));
+            }
+            exit;
         } else {
         
             $id = empty($bits[0]) ? 0 :  $bits[0];