1,'01-01-1980 00:00:00',1,'en','1268315983',1,1, PHP error

PHP error

trim(): Passing null to parameter #1 ($string) of type string is deprecated

/var/www/ls-ce-6x/public/application/helpers/export_helper.php(86)

74     return preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
75 }
76 
77 /**
78 * Quotes a string with surrounding quotes and masking inside quotes by doubling them
79 *
80 * @param string $sText Text to quote
81 * @param string $sQuoteChar The quote character (Use ' for SPSS and " for R)
82 * @param string $aField General field information from SPSSFieldmap
83 */
84 function quoteSPSS($sText, $sQuoteChar, $aField)
85 {
86     $sText = trim($sText);
87     if ($sText == '') {
88         return '';
89     }
90     if (is_numeric($sText) && $aField['SPSStype'] == 'F') {
91         $iDecimals = 0;
92         if (strpos((string) $aField['size'], '.') > 0) {
93             $iDecimals = substr((string) $aField['size'], strpos((string) $aField['size'], '.') + 1);
94         }
95         return number_format($sText, $iDecimals, '.', '');
96     }
97     return $sQuoteChar . str_replace($sQuoteChar, $sQuoteChar . $sQuoteChar, $sText) . $sQuoteChar;
98 }

Stack Trace

#0
+
 /var/www/ls-ce-6x/public/application/helpers/export_helper.php(86): trim(null)
81 * @param string $sQuoteChar The quote character (Use ' for SPSS and " for R)
82 * @param string $aField General field information from SPSSFieldmap
83 */
84 function quoteSPSS($sText, $sQuoteChar, $aField)
85 {
86     $sText = trim($sText);
87     if ($sText == '') {
88         return '';
89     }
90     if (is_numeric($sText) && $aField['SPSStype'] == 'F') {
91         $iDecimals = 0;
#1
+
 /var/www/ls-ce-6x/public/application/helpers/export_helper.php(249): quoteSPSS(null, "'", array("id" => "V8", "name" => "549467X2", "qid" => 398, "code" => "SQ003", ...))
244                     case 'M':
245                         if (substr((string) $field['code'], -7) != 'comment' && substr((string) $field['code'], -5) != 'other') {
246                             if ($row[$fieldno] == 'Y') {
247                                 echo quoteSPSS('1', $q, $field);
248                             } elseif ($row[$fieldno] === '') {
249                                 echo quoteSPSS($sEmptyAnswerValue, $q, $field);
250                             } elseif (isset($row[$fieldno])) {
251                                 echo quoteSPSS('0', $q, $field);
252                             } else {
253                                 echo quoteSPSS($na, $q, $field);
254                             }
#2
+
 /var/www/ls-ce-6x/public/application/controllers/admin/Export.php(436): SPSSExportData(549467, "16384", "", null, ...)
431             if ($spssver == 2 || $spssver == 3) {
432                 echo "\xEF\xBB\xBF";
433             }
434             $sNoAnswerValue = Yii::app()->getRequest()->getPost('noanswervalue');
435             $sEmptyAnswerValue = Yii::app()->getRequest()->getPost('emptyanswervalue');
436             SPSSExportData($iSurveyID, $iLength, $sNoAnswerValue, $sEmptyAnswerValue, '\'', false, $sLanguage);
437 
438             App()->end();
439         }
440 
441         if ($subaction == 'dlstructure') {
2025-06-02 12:19:53 nginx/1.27.5 Yii Framework/1.1.30