CRM-18655: Selected id's not escaped properly
authoryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 23 May 2016 10:42:29 +0000 (16:12 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 23 May 2016 10:42:29 +0000 (16:12 +0530)
----------------------------------------
* CRM-18655: Selected id's not escaped properly
  https://issues.civicrm.org/jira/browse/CRM-18655

CRM/Contact/Page/AJAX.php

index d39afc5da3b456c330493491b9c66dd999339c77..93111583ed9128f69d1a66098921ed4114130df9 100644 (file)
@@ -922,6 +922,7 @@ LIMIT {$offset}, {$rowCount}
         foreach ($elements as $key => $element) {
           $elements[$key] = self::_convertToId($element);
         }
+        CRM_Utils_Type::escapeAll($elements, 'Integer');
         CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $actionToPerform, $elements);
       }
       else {
@@ -930,6 +931,7 @@ LIMIT {$offset}, {$rowCount}
     }
     elseif ($variableType == 'single') {
       $cId = self::_convertToId($name);
+      CRM_Utils_Type::escape($cId, 'Integer');
       $action = ($state == 'checked') ? 'select' : 'unselect';
       CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $action, $cId);
     }