more quoting removal, some slight optimisations

This commit is contained in:
Isaac Connor 2013-10-17 21:03:24 -04:00
parent 92591a6835
commit cde89a7144
2 changed files with 5 additions and 4 deletions

View File

@ -1378,7 +1378,7 @@ function parseFilter( &$filter, $saveToSession=false, $querySep='&' )
if ( isset($filter['terms'][$i]['cnj']) ) if ( isset($filter['terms'][$i]['cnj']) )
{ {
$filter['query'] .= $querySep."filter[terms][$i][cnj]=".urlencode($filter['terms'][$i]['cnj']); $filter['query'] .= $querySep."filter[terms][$i][cnj]=".urlencode($filter['terms'][$i]['cnj']);
$filter['sql'] .= " ".dbEscape($filter['terms'][$i]['cnj'])." "; $filter['sql'] .= " ".$filter['terms'][$i]['cnj']." ";
$filter['fields'] .= "<input type=\"hidden\" name=\"filter[terms][$i][cnj]\" value=\"".htmlspecialchars($filter['terms'][$i]['cnj'])."\"/>\n"; $filter['fields'] .= "<input type=\"hidden\" name=\"filter[terms][$i][cnj]\" value=\"".htmlspecialchars($filter['terms'][$i]['cnj'])."\"/>\n";
} }
if ( isset($filter['terms'][$i]['obr']) ) if ( isset($filter['terms'][$i]['obr']) )

View File

@ -33,8 +33,9 @@ $countSql = "select count(E.Id) as EventCount from Monitors as M inner join Even
$eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,M.DefaultScale,E.Name,E.Width,E.Height,E.Cause,E.Notes,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where"; $eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,M.DefaultScale,E.Name,E.Width,E.Height,E.Cause,E.Notes,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
if ( $user['MonitorIds'] ) if ( $user['MonitorIds'] )
{ {
$countSql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")"; $user_monitor_ids = " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
$eventsSql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")"; $countSql .= $user_monitor_ids;
$eventsSql .= $user_monitor_ids;
} }
else else
{ {
@ -94,7 +95,7 @@ if ( !empty($page) )
} }
elseif ( !empty( $limit ) ) elseif ( !empty( $limit ) )
{ {
$eventsSql .= " limit 0, ".dbEscape($limit); $eventsSql .= " limit 0, $limit";
} }
$maxWidth = 0; $maxWidth = 0;