getNearEvents prev always 0

getNearEvents always returns 0 for prev event.  sortColumn is escaped with passes it with single quotes and breaks the query.  I changed it to match next event by removing the escape.
This commit is contained in:
digital-gnome 2017-09-25 20:33:50 -04:00
parent 1791d3d5b7
commit 7dd95f6afe
1 changed files with 1 additions and 1 deletions

View File

@ -367,7 +367,7 @@ function getNearEvents() {
else
$midSql = '';
$sql = "select E.Id as Id from Events as E inner join Monitors as M on E.MonitorId = M.Id where ".dbEscape($sortColumn)." ".($sortOrder=='asc'?'<=':'>=')." '".$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn ".($sortOrder=='asc'?'desc':'asc');
$sql = "select E.Id as Id from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn ".($sortOrder=='asc'?'<=':'>=')." '".$event[$_REQUEST['sort_field']]."'".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn ".($sortOrder=='asc'?'desc':'asc');
$result = dbQuery( $sql );
while ( $id = dbFetchNext( $result, 'Id' ) ) {
if ( $id == $eventId ) {