View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
16719Bug reportsSurvey takingpublic2022-07-14 00:56
Reporterasshank Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.3.19 
Summary16719: PHP warning: key() expects parameter 1 to be array, string given in ../application/models/Survey.php(667)
Description

We use lime_surveys field attributedescriptions and fill it with text

Steps To Reproduce

If 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 Information

is 667: if ($attdescriptiondata && @strpos(@key(@reset($attdescriptiondata)), 'attribute_') === false) {
an option?

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)4.3.19
I will donate to the project if issue is resolvedNo
Browser-
Database type & versionmysql 5
Server OS (if known)centos7
Webserver software & version (if known)apache
PHP Version7.1

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2022-07-14 00:56

manager   ~70921

Hello asshank,
This should already be fixed in recent versions.
Can you please check if this issue still exists in the latest version of LimeSurvey and let us know?
Thank you!

Issue History

Date Modified Username Field Change
2020-10-05 14:45 asshank New Issue
2022-07-14 00:56 gabrieljenik Assigned To => gabrieljenik
2022-07-14 00:56 gabrieljenik Status new => closed
2022-07-14 00:56 gabrieljenik Resolution open => fixed
2022-07-14 00:56 gabrieljenik Note Added: 70921
2022-07-14 00:56 gabrieljenik Bug heat 0 => 2