Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #119 from madflow/token-sql-injection-vulnerability
Browse files Browse the repository at this point in the history
Fixed issue: CDbCommand "Syntax error or access violation"  with token
  • Loading branch information
Shnoulle committed Sep 5, 2013
2 parents faa775d + 18dda0f commit 91ec43b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/controllers/survey/index.php
Expand Up @@ -602,8 +602,8 @@ function sendreq(surveyid)
if (!isset($_SESSION['survey_'.$surveyid]['srid']) && $thissurvey['anonymized'] == "N" && $thissurvey['active'] == "Y" && isset($token) && $token !='')
{
// load previous answers if any (dataentry with nosubmit)
$sQuery="SELECT id,submitdate,lastpage FROM {$thissurvey['tablename']} WHERE {$thissurvey['tablename']}.token='{$token}' order by id desc";
$aRow = Yii::app()->db->createCommand($sQuery)->queryRow();
$sQuery="SELECT id,submitdate,lastpage FROM {$thissurvey['tablename']} WHERE {$thissurvey['tablename']}.token=:token order by id desc";
$aRow = Yii::app()->db->createCommand($sQuery)->bindValues(array(':token' => $token))->queryRow();
if ( $aRow )
{
if(($aRow['submitdate']=='' && $thissurvey['tokenanswerspersistence'] == 'Y' )|| ($aRow['submitdate']!='' && $thissurvey['alloweditaftercompletion'] == 'Y'))
Expand Down

0 comments on commit 91ec43b

Please sign in to comment.