Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed issue: Search parameter vulnerability in CPDB
  • Loading branch information
c-schmitz committed Jul 2, 2014
1 parent 3a6dd6b commit 9938bcd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -763,9 +763,9 @@ function getParticipantsResults_json()
*/
function getParticipants_json($search = null)
{
$page = Yii::app()->request->getPost('page');
$limit = Yii::app()->request->getPost('rows');
$limit = isset($limit) ? $limit : 50; //Stop division by zero errors
$page = (int) Yii::app()->request->getPost('page');
$limit = (int) Yii::app()->request->getPost('rows');
$limit = empty($limit) ? $limit : 50; //Stop division by zero errors

$attid = ParticipantAttributeName::model()->getVisibleAttributes();
$participantfields = array('participant_id', 'can_edit', 'firstname', 'lastname', 'email', 'blacklisted', 'survey', 'language', 'owner_uid');
Expand All @@ -774,10 +774,11 @@ function getParticipants_json($search = null)
array_push($participantfields, $value['attribute_id']);
}
$sidx = Yii::app()->request->getPost('sidx');
$sidx = !empty($sidx) ? $sidx : "lastname";
$sidx = in_array($sidx,$participantfields) ? $sidx : "lastname";
$sord = Yii::app()->request->getPost('sord');
$sord = !empty($sord) ? $sord : "asc";
$sord = ($sord=='desc') ? 'desc' : 'asc';
$order = $sidx. " ". $sord;


$aData = new stdClass;

Expand Down

0 comments on commit 9938bcd

Please sign in to comment.