----------------------------------------
* CRM-14676: Inserting values into civicrm_prevnext_cache fails to properly escape names
https://issues.civicrm.org/jira/browse/CRM-14676
// build insert query, note that currently we build cache for 500 contact records at a time, hence below approach
$insertValues = array();
while($dao->fetch()) {
- $insertValues[] = "('civicrm_contact', {$dao->contact_id}, {$dao->contact_id}, '{$cacheKey}', '{$dao->sort_name}')";
+ $insertValues[] = "('civicrm_contact', {$dao->contact_id}, {$dao->contact_id}, '{$cacheKey}', '" . CRM_Core_DAO::escapeString($dao->sort_name) . "')";
}
//update pre/next cache using single insert query