CHttpException

Disable for security reasons.

E:\WebSite\limesurvey\application\controllers\admin\responses.php(643)

631         }
632 
633         if (Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'read')) {
634             $oResponse = Response::model($iSurveyId)->findByPk($iResponseId);
635             $aQuestionFiles = $oResponse->getFiles($iQID);
636             if (isset($aQuestionFiles[$iIndex])) {
637                 $aFile = $aQuestionFiles[$iIndex];
638                 // Real path check from here: https://stackoverflow.com/questions/4205141/preventing-directory-traversal-in-php-but-allowing-paths
639                 $sDir = Yii::app()->getConfig('uploaddir') . "/surveys/" . $iSurveyId . "/files/";
640                 $sFileRealName = $sDir . $aFile['filename'];
641                 $sRealUserPath = realpath($sFileRealName);
642                 if ($sRealUserPath === false || strpos($sRealUserPath, $sDir) !== 0) {
643                     throw new CHttpException(403, "Disable for security reasons.");
644                 } else {
645                     $mimeType = CFileHelper::getMimeType($sFileRealName, null, false);
646                     if (is_null($mimeType)) {
647                         $mimeType = "application/octet-stream";
648                     }
649                     @ob_clean();
650                     header('Content-Description: File Transfer');
651                     header('Content-Type: '.$mimeType);
652                     header('Content-Disposition: attachment; filename="'.sanitize_filename(rawurldecode($aFile['name'])).'"');
653                     header('Content-Transfer-Encoding: binary');
654                     header('Expires: 0');
655                     header("Cache-Control: must-revalidate, no-store, no-cache");

Stack Trace

#2
+
 E:\WebSite\limesurvey\application\core\Survey_Common_Action.php(83): CAction->runWithParamsInternal(responses, ReflectionMethod, array("r" => "admin/responses", "sa" => "actionDownloadfile", "surveyid" => "558129", "iResponseId" => "51", ...))
78             $oMethod = new ReflectionMethod($this, $sDefault);
79         }
80 
81         // We're all good to go, let's execute it
82         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
83         return parent::runWithParamsInternal($this, $oMethod, $params);
84     }
85 
86     /**
87      * Some functions have different parameters, which are just an alias of the
88      * usual parameters we're getting in the url. This function just populates
#6
+
 E:\WebSite\limesurvey\application\controllers\AdminController.php(165): CController->run("responses")
160                     $this->redirect(array('/admin/authentication/sa/login'));
161                 }
162             }
163         }
164 
165         return parent::run($action);
166     }
167 
168     /**
169      * Routes all the actions to their respective places
170      *
#10
+
 E:\WebSite\limesurvey\index.php(194): CApplication->run()
189 require_once APPPATH . 'core/LSYii_Application' . EXT;
190 
191 $config = require_once(APPPATH . 'config/internal' . EXT);
192 
193 Yii::$enableIncludePath = false;
194 Yii::createApplication('LSYii_Application', $config)->run();
195 
196 /* End of file index.php */
197 /* Location: ./index.php */
2022-12-02 10:36:28 Microsoft-IIS/10.0 Yii Framework/1.1.24-dev