fix parsing StorageID

pull/3038/head
Isaac Connor 2017-01-09 14:59:14 -05:00
parent 7ef0c2c9d3
commit 03fd964518
1 changed files with 3 additions and 2 deletions

View File

@ -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