Skip to content

Commit

Permalink
Fixed issue: Can't download individual files with special chars in fi…
Browse files Browse the repository at this point in the history
…le name
  • Loading branch information
c-schmitz committed Dec 12, 2013
1 parent 9de0108 commit e64f2a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/controllers/admin/responses.php
Expand Up @@ -244,7 +244,7 @@ public function view($iSurveyID, $iId, $sBrowseLang = '')
if ($metadata === "size")
$answervalue = rawurldecode(((int) ($phparray[$index][$metadata])) . " KB");
else if ($metadata === "name")
$answervalue = CHtml::link(rawurldecode($phparray[$index][$metadata]), $this->getController()->createUrl("/admin/responses/sa/browse/downloadindividualfile/{$phparray[$index][$metadata]}/fieldname/{$fnames[$i][0]}/id/{$iId}/surveyid/{$iSurveyID}"));
$answervalue = CHtml::link(rawurldecode($phparray[$index][$metadata]), $this->getController()->createUrl("/admin/responses/sa/browse/fieldname/{$fnames[$i][0]}/id/{$iId}/surveyid/{$iSurveyID}",array('downloadindividualfile'=>$phparray[$index][$metadata])));
else
$answervalue = rawurldecode($phparray[$index][$metadata]);
}
Expand Down Expand Up @@ -405,7 +405,7 @@ function browse($iSurveyID)

for ($i = 0; $i < count($phparray); $i++)
{
if ($phparray[$i]['name'] == $downloadindividualfile)
if (rawurldecode($phparray[$i]['name']) == rawurldecode($downloadindividualfile))
{
$file = Yii::app()->getConfig('uploaddir') . "/surveys/" . $iSurveyID . "/files/" . $phparray[$i]['filename'];

Expand Down

0 comments on commit e64f2a4

Please sign in to comment.