Skip to content

Commit

Permalink
validation for select all before query
Browse files Browse the repository at this point in the history
  • Loading branch information
mathavanveda committed Apr 21, 2015
1 parent 6b5d880 commit e8d6758
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions CRM/Contact/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -987,15 +987,13 @@ static function toggleDedupeSelect() {
$whereClause = NULL;
if (is_array($pnid) && !CRM_Utils_Array::crmIsEmptyArray($pnid)) {
$pnid = implode(', ', $pnid);
if (CRM_Utils_Type::escape($pnid, 'String')) {
$whereClause = " id IN ( {$pnid} ) ";
}
$pnid = CRM_Utils_Type::escape($pnid, 'String');
$whereClause = " id IN ( {$pnid} ) ";
}
else {
if (CRM_Utils_Type::escape($pnid, 'Integer')) {
$whereClause = " id = %2";
$params[2] = array($pnid, 'Integer');
}
$pnid = CRM_Utils_Type::escape($pnid, 'Integer');
$whereClause = " id = %2";
$params[2] = array($pnid, 'Integer');
}

$sql = "UPDATE civicrm_prevnext_cache SET is_selected = %1 WHERE {$whereClause} AND cacheKey LIKE %3";
Expand Down

0 comments on commit e8d6758

Please sign in to comment.