View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
14436Bug reportsSurvey editingpublic2021-03-20 11:57
Reporterjelo Assigned Toc_schmitz  
PrioritylowSeverityminor 
Status closedResolutionunable to reproduce 
Product Version3.15.x 
Summary14436: KCFinder breaks under PHP 7.2 via graphic library to create thumbs
Description

When uploading a file via KCFinder under PHP 7.1 everything works as expected.
When switching to PHP 7.2. the uploading will still end in the attached error message.

"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Internal Server Error
The each() function is deprecated. This message will be suppressed on further calls
An internal error occurred while the Web server was processing your request. Please contact the webmaster to report this problem. Thank you.

The script /third_party/kcfinder/core/class/browser.php is not working correctly under PHP 7.2 in combination with certain graphic libraries. I guess it is GD. When I comment out the thumb creation part in browser.php the error message with stil be shown but KCFinder still be usable.
If you e.g. upload PDF documents the error is not triggered.

The error is limited to images and thumbs, when the browser.php scanning through the files.
Since KCFinder is able to use different imagesdrivers, it might be not reproducible with every php 7.2 setup
KCFinder is choosing the graphic library via 'imageDriversPriority' => "imagick gmagick gd".

Additional Information

When you comment out the part to create thumbs, the error message will still come but you can work on.
/* if (is_array($size) && count($size)) {
$thumb_file = "$thumbDir/" . basename($file);
if (!is_file($thumb_file))
$this->makeThumb($file, false);
$smallThumb =
($size[0] <= $this->config['thumbWidth']) &&
($size[1] <= $this->config['thumbHeight']) &&
in_array($type, array("gif", "jpeg", "png"));
} else
$smallThumb = false;
/

TagsNo tags attached.
Attached Files
20191117kcfinderuploadthumb.PNG (39,238 bytes)   
20191117kcfinderuploadthumb.PNG (39,238 bytes)   
Bug heat10
Complete LimeSurvey version number (& build)3.15.6+190108
I will donate to the project if issue is resolvedNo
BrowserFirefox
Database type & versionMySQL
Server OS (if known)
Webserver software & version (if known)
PHP Version7.2.14

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2019-01-17 18:09

developer   ~50258

KCFinder is choosing the graphic library via 'imageDriversPriority' => "imagick gmagick gd".

Wher is this link ? To test ?

jelo

jelo

2019-01-17 18:49

partner   ~50259

https://github.com/LimeSurvey/LimeSurvey/blob/master/third_party/kcfinder/conf/config.php#L45

Not sure if it is really used in the modified LS KCFinder.
Just a sign for me that KCFinder might behave differently when only one graphic library is available via PHP.

DenisChenu

DenisChenu

2019-01-17 18:55

developer   ~50260

Maybe, but since i have imagick + gd : i can remove imagick from this line to force gs.

I set this line to 'imageDriversPriority' => "gd", and don't have issue …

This is my current gd settings

gd
GD Support  enabled
GD headers Version  2.2.5
GD library Version  2.2.5
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.9.1
GIF Read Support    enabled
GIF Create Support  enabled
JPEG Support    enabled
libJPEG Version     6b
PNG Support     enabled
libPNG Version  1.6.34
WBMP Support    enabled
XPM Support     enabled
libXpm Version  30411
XBM Support     enabled
WebP Support    enabled
Directive   Local Value Master Value
gd.jpeg_ignore_warning  1   1
jelo

jelo

2019-01-17 20:15

partner   ~50261

But I don't see any impact in terms of disabling a library via removing the entry from that line.

If I remove GD extension directly from PHP , KCFinder will display:
Cannot find any of the supported PHP image extensions!
Which is correct, since no imagick gmagick is available and PHP isn't having GD.

When I remove GD just from 'imageDriversPriority' => "imagick gmagick" I get no warning and KCFinder tries to create the thumb in PHP 7.1 (with the error).

If I use PHP 7.1 with 'imageDriversPriority' => "imagick gmagick", it still creates the thumbnail via GD.

DenisChenu

DenisChenu

2019-01-18 08:29

developer   ~50262

I don't look at code, but if i have gd, and gd is 1st in priority : kcfinder take gd, no ?

jelo

jelo

2019-01-18 09:22

partner   ~50263

I have no debugger on the PHP code running.

To test impact of 'imageDriversPriority'. I did the following.
I used a PHP 7.1 with GD as the only available available graphic library.
I removed GD from 'imageDriversPriority'.
If 'imageDriversPriority' would control the usage of the graphic library, KCFinder shouldn't create a thumb.
But KCFinder creates a thumb, even though GD is NOT in 'imageDriversPriority' at all.

DenisChenu

DenisChenu

2019-02-07 12:54

developer   ~50436

Last edited: 2019-03-26 18:14

I can not reproduce on PHP7.2.9 + IIS server + gd bundle (2.1.0 compatible)

DenisChenu

DenisChenu

2019-02-07 12:55

developer   ~50437

Maybe start by : https://github.com/sunhater/kcfinder/issues/169

DenisChenu

DenisChenu

2019-02-07 13:05

developer   ~50438

Last edited: 2019-02-07 13:05

Same server type : Windows IIS + PHP7.2.12 (same gd version) : it's OK. Maybe an issue in php version ?
OR : debug : 1/2

Mazi

Mazi

2019-03-26 17:13

updater   ~51140

@jelo, Will you get that error message from the screenshot all the time or only if debug mode is enabled?

DenisChenu

DenisChenu

2019-03-26 18:15

developer   ~51141

Last edited: 2019-03-26 18:17

@dominikvitt : This commit https://github.com/LimeSurvey/LimeSurvey/commit/79324b3fe1284f67c2849d6c407bc20e94f022b4#diff-6a6097871a7a28a752d81e9451763259 fix this issue , no ?

Maybe need a bad image in the images upload dir ?

jelo

jelo

2019-03-26 19:59

partner   ~51144

@Mazi: Debugmode was off.

But I haven't tested the newer LS releases under PHP 7.2 and CentOS 7.

cdorin

cdorin

2021-02-07 10:30

reporter   ~61969

Don't think I saw any similar reports so far - tried to reproduce with php 7.2 + ubuntu 18 + mysql without any success.
Do you still have the issue, @jelo?

c_schmitz

c_schmitz

2021-03-20 11:56

administrator   ~63499

Hello jelo,

we have asked for feedback on this issue. Because we did not get an answer we assume that the issue is resolved.
However, should you be able to reproduce the issue using the latest version, please feel free to re-open the issue and give us exact details on how to reproduce it.

Thank you and best regards,

c_schmitz

Issue History

Date Modified Username Field Change
2019-01-17 16:23 jelo New Issue
2019-01-17 16:23 jelo File Added: 20191117kcfinderuploadthumb.PNG
2019-01-17 18:09 DenisChenu Note Added: 50258
2019-01-17 18:49 jelo Note Added: 50259
2019-01-17 18:55 DenisChenu Note Added: 50260
2019-01-17 20:15 jelo Note Added: 50261
2019-01-18 08:29 DenisChenu Note Added: 50262
2019-01-18 09:22 jelo Note Added: 50263
2019-02-07 12:54 DenisChenu Note Added: 50436
2019-02-07 12:55 DenisChenu Note Added: 50437
2019-02-07 13:05 DenisChenu Note Added: 50438
2019-02-07 13:05 DenisChenu Note Edited: 50438
2019-03-26 17:13 Mazi Note Added: 51140
2019-03-26 18:14 DenisChenu Note Edited: 50436
2019-03-26 18:15 DenisChenu Note Added: 51141
2019-03-26 18:15 DenisChenu Note Edited: 51141
2019-03-26 18:15 DenisChenu Assigned To => dominikvitt
2019-03-26 18:15 DenisChenu Status new => feedback
2019-03-26 18:17 DenisChenu Note Edited: 51141
2019-03-26 19:59 jelo Note Added: 51144
2019-03-26 19:59 jelo Status feedback => assigned
2019-07-15 11:41 dominikvitt Assigned To dominikvitt => cdorin
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-02-07 10:30 cdorin Assigned To cdorin =>
2021-02-07 10:30 cdorin Priority none => low
2021-02-07 10:30 cdorin Status assigned => feedback
2021-02-07 10:30 cdorin Note Added: 61969
2021-03-20 11:56 c_schmitz Note Added: 63499
2021-03-20 11:57 c_schmitz Assigned To => c_schmitz
2021-03-20 11:57 c_schmitz Status feedback => closed
2021-03-20 11:57 c_schmitz Resolution open => unable to reproduce