From 13c42e60c1a93c814d17ddfa835980ca52cf41fb Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Tue, 26 Apr 2016 07:51:22 +0200 Subject: [PATCH] Just discovered CRM_Utils_Type::escapeAll --- CRM/Contact/Page/AJAX.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index e4c8d75275..fa3902b4ee 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -892,9 +892,7 @@ LIMIT {$offset}, {$rowCount} INNER JOIN civicrm_prevnext_cache old on cpc.id = old.id SET cpc.entity_id1 = cpc.entity_id2, cpc.entity_id2 = old.entity_id1 "; if (is_array($prevNextId) && !CRM_Utils_Array::crmIsEmptyArray($prevNextId)) { - foreach ($prevNextId as $id) { - CRM_Utils_Type::escape($id, 'Positive'); - } + CRM_Utils_Type::escapeAll($prevNextId, 'Positive'); $prevNextId = implode(', ', $prevNextId); $query .= "WHERE cpc.id IN ({$prevNextId}) AND cpc.is_selected = 1"; } @@ -993,9 +991,7 @@ LIMIT {$offset}, {$rowCount} //check pnid is_array or integer $whereClause = NULL; if (is_array($pnid) && !CRM_Utils_Array::crmIsEmptyArray($pnid)) { - foreach ($pnid as $id) { - CRM_Utils_Type::escape($id, 'Positive'); - } + CRM_Utils_Type::escapeAll($pnid, 'Positive'); $pnid = implode(', ', $pnid); $whereClause = " id IN ( {$pnid} ) "; } -- 2.25.1