View Issue Details

This bug affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
17472Bug reports_ Unknownpublic2021-07-26 13:17
Reporteruibklime1 Assigned Togalads  
PrioritynoneSeverityminor 
Status confirmedResolutionopen 
Product Version3.25.20 
Summary17472: PHP 7.3 complains of deprecated code
Description

With debugging enabled, we get the following errors on a regular basis:

stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior (.../application/helpers/questionHelper.php:1613)

Steps To Reproduce

I don't know WHEN this happens, as I'm not the user, only the site admin. But it appears to happen on our side 20x+ times per day.

Additional Information

Code at https://github.com/LimeSurvey/LimeSurvey/blob/3.x-LTS/application/helpers/questionHelper.php#L1614 reads

            return stripos($attribute['types'], $sType) !== false;

I'm guessing this needs to be :

            return stripos($attribute['types'], chr($sType)) !== false;

From php manual:

Prior to PHP 8.0.0, if needle is not a string, it is converted to an integer and applied as the ordinal value of a character. This behavior is deprecated as of PHP 7.3.0, and relying on it is highly discouraged. Depending on the intended behavior, the needle should either be explicitly cast to string, or an explicit call to chr() should be performed.

TagsNo tags attached.
Bug heat0
Complete LimeSurvey version number (& build)3.22.4+200212 and current in git
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmysql 5.7
Server OS (if known)
Webserver software & version (if known)
PHP Version7.3.24

Users monitoring this issue

There are no users monitoring this issue.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-07-24 17:31 uibklime1 New Issue
2021-07-26 13:17 galads Assigned To => galads
2021-07-26 13:17 galads Status new => confirmed