fix Event being undefined when called by path

This commit is contained in:
Isaac Connor 2017-01-13 14:42:10 -05:00
parent 21c1e1d26f
commit 2ce4bad39b
1 changed files with 4 additions and 2 deletions

View File

@ -54,12 +54,12 @@ if (!function_exists('imagescale')) {
$errorText = false;
$filename = '';
$Frame = null;
$Event = null;
if ( empty($_REQUEST['path']) ) {
if ( ! empty($_REQUEST['fid']) ) {
$show = empty($_REQUEST['show']) ? 'capture' : $_REQUEST['show'];
$Frame = null;
$Event = null;
if ( ! empty($_REQUEST['eid'] ) ) {
$Event = new Event( $_REQUEST['eid'] );
@ -148,8 +148,10 @@ if( !empty($_REQUEST['height']) ) {
header( 'Content-type: image/jpeg' );
# This is so that Save Image As give a useful filename
if ( $Event ) {
$filename = $Event->MonitorId().'_'.$Event->Id().'_'.$Frame->FrameId().'.jpg';
header('Content-Disposition: inline; filename="' . $filename . '"');
}
ob_clean();
flush();