View Issue Details

This issue affects 1 person(s).
 12
IDProjectCategoryView StatusLast Update
18272Bug reportsImport/Exportpublic2026-11-02 16:02
ReporterFrustrated Assigned Toc_schmitz  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version5.3.x 
Summary18272: getMaximumFileUploadSize() returns zero if post_max_size is set to 0 in php.ini
Description

The function getMaximumFileUploadSize() incorrectly returns zero of the PHP configuration file php.ini has post_max_size set to 0.

According to the documentation in php.ini this should disable the maximum size of an uploaded file:

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; https://php.net/post-max-size
post_max_size = 0

Steps To Reproduce

Steps to reproduce

Edit your system's php.ini file (/etc/php/8.1/fpm/php.ini, for instance) to

post_max_size = 0

Try to upload a vvexport file, for instance.

Expected result

Should upload, not show message "Sorry, this file is too large. Only files up to 0.0 MB are allowed."

(Write here what you expected to happen)

Actual result

(Write here what happened instead)

TagsNo tags attached.
Bug heat12
Complete LimeSurvey version number (& build)Version 5.3.12+220502 + 3.28.9
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)Linux
Webserver software & version (if known)not relevant
PHP VersionPHP 8.1.2 + 7.4
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2022-07-25 10:17

reporter   ~71116

Hm, this is not a change in PHP 8.1, is it?

DenisChenu

DenisChenu

2022-07-25 11:15

developer   ~71117

Can confirm in 3.28.9 / PHP 7.4

DenisChenu

DenisChenu

2022-07-25 11:16

developer   ~71118

Confirm and debin/linux, nginx+mariadb

Frustrated

Frustrated

2022-07-25 15:44

reporter   ~71120

I can't speak for previous editions of PHP but in 7.4 the configuration file is similar:

/etc/php/7.4/apache2

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 0

gabrieljenik

gabrieljenik

2022-08-22 18:11

developer   ~71511

The function getMaximumFileUploadSize() is used in about 25 places in the code.
Sometimes in the context of displaying the max file size to upload, some others to validate the filesize uploaded.

Patching it could take some effort and also in terms of testing.

So, not the greatest solution, but if the PHP setting is on 0 on PHP, can we derive it then from a config setting which coud be really big?
Having this setting on Zero is far away from usual.

Thoughts @ollehar?

c_schmitz

c_schmitz

2026-10-30 17:01

administrator   ~87029

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=41180

LimeBot

LimeBot

2026-11-02 16:02

administrator   ~87150

Fixed in Release 7.9.1+261102

Related Changesets

LimeSurvey: master 8b81690d

2026-10-30 17:00

c_schmitz


Details Diff
Fixed issue 18272: When PHP's post_max_size or upload_max_filesize was set to 0 (no limit), every file upload was rejected as too large with a maximum of 0.00 MB
Dev getMaximumFileUploadSize() ignores PHP limits of 0 or less and returns PHP_INT_MAX if there is none, new isFileUploadSizeLimited() hides the maximum size hints in that case
Affected Issues
18272
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/questionHelper.php Diff File
mod - application/models/services/UploadValidator.php Diff File
mod - application/views/admin/dataentry/vvimport.php Diff File
mod - application/views/admin/labels/editlabel_view.php Diff File
mod - application/views/admin/pluginmanager/uploadModal.php Diff File
mod - application/views/admin/themes/templatesummary_view.php Diff File
mod - application/views/questionAdministration/importQuestion.php Diff File
mod - application/views/questionGroupsAdministration/importGroup_view.php Diff File
mod - application/views/surveyAdministration/partial/_modalImportSurvey.php Diff File
mod - application/views/surveyAdministration/tabImport_view.php Diff File
mod - application/views/themeOptions/advanced.php Diff File
mod - application/views/themeOptions/import_modal.php Diff File
mod - application/views/themeOptions/options_core.php Diff File

Issue History

Date Modified Username Field Change
2022-07-24 01:05 Frustrated New Issue
2022-07-25 10:17 ollehar Note Added: 71116
2022-07-25 10:17 ollehar Bug heat 0 => 2
2022-07-25 11:15 DenisChenu Status new => confirmed
2022-07-25 11:15 DenisChenu Note Added: 71117
2022-07-25 11:15 DenisChenu Bug heat 2 => 4
2022-07-25 11:16 DenisChenu Complete LimeSurvey version number (& build) Version 5.3.12+220502 => Version 5.3.12+220502 + 3.28.9
2022-07-25 11:16 DenisChenu Browser n/a => not relevant
2022-07-25 11:16 DenisChenu Database type & version postgres (PostgreSQL) 14.4 (Ubuntu 14.4-0ubuntu0.22.04.1) => not relevant
2022-07-25 11:16 DenisChenu Server OS (if known) Linux george 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux => Linux
2022-07-25 11:16 DenisChenu Webserver software & version (if known) Server version: Apache/2.4.54 (Ubuntu)Server built: 2022-06-08T15:59:33 => not relevant
2022-07-25 11:16 DenisChenu PHP Version PHP 8.1.2 => PHP 8.1.2 + 7.4
2022-07-25 11:16 DenisChenu Note Added: 71118
2022-07-25 15:44 Frustrated Note Added: 71120
2022-07-25 15:44 Frustrated Bug heat 4 => 6
2022-08-04 15:40 gabrieljenik Assigned To => gabrieljenik
2022-08-04 15:40 gabrieljenik Status confirmed => assigned
2022-08-22 18:11 gabrieljenik Note Added: 71511
2022-08-22 18:11 gabrieljenik Bug heat 6 => 8
2022-08-22 18:12 gabrieljenik Status assigned => feedback
2026-10-30 17:01 c_schmitz Changeset attached => LimeSurvey master 8b81690d
2026-10-30 17:01 c_schmitz Note Added: 87029
2026-10-30 17:01 c_schmitz Assigned To gabrieljenik => c_schmitz
2026-10-30 17:01 c_schmitz Status feedback => resolved
2026-10-30 17:01 c_schmitz Resolution open => fixed
2026-10-30 17:01 c_schmitz Bug heat 8 => 10
2026-11-02 16:02 LimeBot Note Added: 87150
2026-11-02 16:02 LimeBot Status resolved => closed
2026-11-02 16:02 LimeBot Bug heat 10 => 12