diff --git a/web/includes/functions.php b/web/includes/functions.php index 6e546640a..9fb074f4e 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1188,6 +1188,7 @@ function parseFilter( &$filter, $saveToSession=false, $querySep='&' ) { case 'Name': case 'MonitorId': case 'StorageId': + $StorageArea = new Storage( $filter['terms'][$i]['val'] ); case 'Length': case 'Frames': case 'AlarmFrames': @@ -1203,8 +1204,8 @@ function parseFilter( &$filter, $saveToSession=false, $querySep='&' ) { // Need to specify a storage area, so need to look through other terms looking for a storage area, else we default to ZM_EVENTS_PATH if ( ! $StorageArea ) { for ( $j = $i; $j < count($filter['terms']); $j++ ) { - if ( isset($filter['terms'][$i]['attr']) and $filter['terms'][$i]['attr'] == 'StorageId' ) { - $StorageArea = new Storage( $filter['terms'][$i]['val'] ); + if ( isset($filter['terms'][$j]['attr']) and $filter['terms'][$j]['attr'] == 'StorageId' ) { + $StorageArea = new Storage( $filter['terms'][$j]['val'] ); } } // end foreach remaining term } // end no StorageArea found yet