From da5b36a203ebffdd406661252661e1b0dcfc5c19 Mon Sep 17 00:00:00 2001 From: lapiudevgit Date: Mon, 5 Jun 2023 14:03:14 -0300 Subject: [PATCH] Fixed issue #18368: export_statistics from API Yields error --- application/helpers/remotecontrol/remotecontrol_handle.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/helpers/remotecontrol/remotecontrol_handle.php b/application/helpers/remotecontrol/remotecontrol_handle.php index f51d3c7d24c..0ddf7828392 100644 --- a/application/helpers/remotecontrol/remotecontrol_handle.php +++ b/application/helpers/remotecontrol/remotecontrol_handle.php @@ -573,16 +573,17 @@ public function export_statistics($sSessionKey, $iSurveyID, $docType = 'pdf', $s $aSummary = createCompleteSGQA($iSurveyID, $oAllQuestions, $sLanguage); $helper = new statistics_helper(); + $tempDir = Yii::app()->getConfig("tempdir"); switch ($docType) { case 'pdf': - $sTempFile = sanitize_filename( + $sTempFile = $tempDir . DIRECTORY_SEPARATOR . sanitize_filename( $helper->generate_statistics($iSurveyID, $aSummary, $aSummary, $graph, $docType, 'F', $sLanguage) ); $sResult = file_get_contents($sTempFile); unlink($sTempFile); break; case 'xls': - $sTempFile = sanitize_filename( + $sTempFile = $tempDir . DIRECTORY_SEPARATOR . sanitize_filename( $helper->generate_statistics($iSurveyID, $aSummary, $aSummary, '0', $docType, 'F', $sLanguage) ); $sResult = file_get_contents($sTempFile);