View Issue Details

IDProjectCategoryView StatusLast Update
16719Bug reportsSurvey takingpublic2020-10-05 14:45
Reporterasshank Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version4.3.19 
Summary16719: PHP warning: key() expects parameter 1 to be array, string given in ../application/models/Survey.php(667)
DescriptionWe use lime_surveys field attributedescriptions and fill it with text
 
Steps To ReproduceIf lime_surveys field attributedescriptions is not an array this warning is thrown in /application/models/Survey.php(667)

=================================================
     * @access public
656 * @return array
657 */
658 public function getTokenAttributes()
659 {
660 $attdescriptiondata = decodeTokenAttributes($this->attributedescriptions);
661 // checked for invalid data
662 if ($attdescriptiondata == null) {
663 return array();
664 }
665
666 // Catches malformed data
667 if ($attdescriptiondata && strpos(key(reset($attdescriptiondata)), 'attribute_') === false) {
668 // don't know why yet but this breaks normal tokenAttributes functionning
669 //$attdescriptiondata=array_flip(GetAttributeFieldNames($this->sid));
670 } elseif (is_null($attdescriptiondata)) {
671 $attdescriptiondata = array();
672 }
673 // Legacy records support
674 if ($attdescriptiondata === false) {
675 $attdescriptiondata = explode("\n", $this->attributedescriptions);
676 $fields = array();
677 $languagesettings = array();
678 foreach ($attdescriptiondata as $attdescription) {
679 if (trim($attdescription) != '') {
Additional Informationis 667: if ($attdescriptiondata && @strpos(@key(@reset($attdescriptiondata)), 'attribute_') === false) {
an option?
TagsNo tags attached.
Complete LimeSurvey version number (& build)4.3.19
I will donate to the project if issue is resolvedNo
Browser-
Database & DB-Versionmysql 5
Server OS (if known)centos7
Webserver software & version (if known)apache
PHP Version7.1

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-10-05 14:45 asshank New Issue