View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
19825Bug reportsOtherpublic2025-01-06 17:13
Reporterc_schmitz Assigned Totibor.pacalat  
PriorityhighSeverityminor 
Status ready for testingResolutionopen 
Product Version6.6.x 
Summary19825: Replace PclZip class with ZipArchive
Description

The PclZip class is kind out of support and it would be in general better to replace it with the PHP-internal ZIPArchive class.

Steps To Reproduce

(Write here what happened instead)

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)6.x
I will donate to the project if issue is resolvedNo
Browser
Database type & versionn/a
Server OS (if known)
Webserver software & version (if known)
PHP Versionn/a

Relationships

related to 18697 assignedc_schmitz Importing resources in IIS doesn't work. 

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2024-11-08 13:58

administrator   ~81364

@DenisChenu or @gabrieljenik ?

gabrieljenik

gabrieljenik

2024-11-13 16:32

manager   ~81375

I can take it... @DenisChenu are you ok with that?

DenisChenu

DenisChenu

2024-11-13 17:10

developer   ~81376

OK for me

gabrieljenik

gabrieljenik

2024-12-16 20:25

manager   ~81644

https://github.com/LimeSurvey/LimeSurvey/pull/4099

DenisChenu

DenisChenu

2024-12-17 08:37

developer   ~81646

I think it's better to remove the todo and do it :)

Like you want

tibor.pacalat

tibor.pacalat

2024-12-23 16:32

administrator   ~81721

@gabrieljenik I have pretty fresh local setup, after switching to your branch I am getting error with debug=2 when I try to export resources as zip or import zip file.

gabrieljenik

gabrieljenik

2024-12-30 20:48

manager   ~81726

Can you please send me the full stack trace? instead of capturing with a picture you could save the page as pdf...

tibor.pacalat

tibor.pacalat

2025-01-06 17:13

administrator   ~81743

PHP error
Return type of LimeSurvey\Zip::open($filename, $flags = null, $checkZipBomb = true) should either be compatible with ZipArchive::open(string $filename, int $flags = 0): int|bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

/var/www/ls-ce-6x/public/application/libraries/Zip.php(16)

04
05 /
06 Extends ZipArchive class to add a check for Zip Bombing
07
/
08 class Zip extends \ZipArchive
09 {
10 protected $opened = false;
11
12 /

13 @inheritdoc
14
@param bool $checkZipBomb If true, check for Zip Bombing
15 */
16 public function open($filename, $flags = null, $checkZipBomb = true)
17 {
18 $result = parent::open($filename, $flags);
19 $this->opened = ($result === true);
20 if ($result === true && $checkZipBomb && $this->isZipBomb()) {
21 throw new \Exception("Unzipped file is bigger than upload_max_filesize or post_max_size");
22 }
23 return $result;
24 }
25
26 /*
27
@inheritdoc
28 /
Stack Trace
#0
– /var/www/ls-ce-6x/public/vendor/composer/ClassLoader.php(571): include("/var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/base/CAppl...")
566
@return void
567 @private
568
/
569 function includeFile($file)
570 {
571 include $file;
572 }
#1
– /var/www/ls-ce-6x/public/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile("/var/www/ls-ce-6x/public/vendor/composer/../../application/libra...")
423 @return true|null True if loaded, null otherwise
424
/
425 public function loadClass($class)
426 {
427 if ($file = $this->findFile($class)) {
428 includeFile($file);
429
430 return true;
431 }
432
433 return null;
#2
– /var/www/ls-ce-6x/public/application/controllers/admin/Export.php(787): Composer\Autoload\ClassLoader->loadClass("LimeSurvey\Zip")
782
783 if (!empty($zipfilename) && !empty($resourcesdir)) {
784 $resourcesdir = Yii::app()->getConfig('uploaddir') . "/{$resourcesdir}/";
785 $tmpdir = Yii::app()->getConfig('tempdir') . '/';
786 $zipfilepath = $tmpdir . $zipfilename;
787 $zip = new LimeSurvey\Zip();
788 if ($zip->open($zipfilepath, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== true) {
789 throw new Exception("Error : " . $zip->getStatusString());
790 }
791 foreach (array('files', 'flash', 'images') as $zipdir) {
792 if (is_dir($resourcesdir . $zipdir)) {
#3
unknown(0): Export->resources()
#4

  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/web/actions/CAction.php(114): ReflectionMethod->invokeArgs(Export, array())
    #5
  • /var/www/ls-ce-6x/public/application/core/SurveyCommonAction.php(83): CAction->runWithParamsInternal(Export, ReflectionMethod, array("export" => "survey", "surveyid" => 492479, "sa" => "resources", "iSurveyId" => 492479, ...))
    #6
  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/web/CController.php(308): SurveyCommonAction->runWithParams(array("export" => "survey", "surveyid" => 492479, "sa" => "resources", "iSurveyId" => 492479, ...))
    #7
  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/web/CController.php(286): CController->runAction(Export)
    #8
  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/web/CController.php(265): CController->runActionWithFilters(Export, array())
    #9
  • /var/www/ls-ce-6x/public/application/controllers/AdminController.php(202): CController->run("export")
    #10
  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/web/CWebApplication.php(282): AdminController->run("export")
    #11
  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/export/sa/resources")
    #12
  • /var/www/ls-ce-6x/public/vendor/yiisoft/yii/framework/base/CApplication.php(185): CWebApplication->processRequest()
    #13
  • /var/www/ls-ce-6x/public/index.php(161): CApplication->run()
    2025-01-06 16:13:26 nginx/1.25.3 Yii Framework/1.1.29

Fatal error: Object of class UnwindExit could not be converted to string in /var/www/ls-ce-6x/public/application/libraries/Zip.php on line 0

Issue History

Date Modified Username Field Change
2024-11-08 13:39 c_schmitz New Issue
2024-11-08 13:40 c_schmitz Relationship added related to 18697
2024-11-08 13:43 c_schmitz Assigned To => gabrieljenik
2024-11-08 13:43 c_schmitz Status new => assigned
2024-11-08 13:44 c_schmitz Assigned To gabrieljenik =>
2024-11-08 13:44 c_schmitz Priority none => high
2024-11-08 13:44 c_schmitz Status assigned => new
2024-11-08 13:58 c_schmitz Note Added: 81364
2024-11-08 13:58 c_schmitz Bug heat 0 => 2
2024-11-08 14:21 tibor.pacalat Assigned To => DenisChenu
2024-11-08 14:21 tibor.pacalat Status new => assigned
2024-11-13 16:32 gabrieljenik Note Added: 81375
2024-11-13 16:32 gabrieljenik Bug heat 2 => 4
2024-11-13 17:10 DenisChenu Assigned To DenisChenu => gabrieljenik
2024-11-13 17:10 DenisChenu Note Added: 81376
2024-11-13 17:10 DenisChenu Bug heat 4 => 6
2024-12-16 20:25 gabrieljenik Status assigned => ready for code review
2024-12-16 20:25 gabrieljenik Note Added: 81644
2024-12-16 20:25 gabrieljenik Assigned To gabrieljenik => DenisChenu
2024-12-17 08:37 DenisChenu Assigned To DenisChenu => gabrieljenik
2024-12-17 08:37 DenisChenu Status ready for code review => in code review
2024-12-17 08:37 DenisChenu Note Added: 81646
2024-12-18 09:17 DenisChenu Assigned To gabrieljenik => tibor.pacalat
2024-12-18 09:17 DenisChenu Status in code review => ready for testing
2024-12-23 16:32 tibor.pacalat Note Added: 81721
2024-12-23 16:32 tibor.pacalat File Added: Screenshot 2024-12-23 at 15.53.31.png
2024-12-23 16:32 tibor.pacalat Bug heat 6 => 8
2024-12-30 20:48 gabrieljenik Note Added: 81726
2025-01-06 17:13 tibor.pacalat Note Added: 81743