Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
27 Aug 2021

Pull Request for Issue #35360

Summary of Changes

Remove check to memory_limit when uploading files.

Testing Instructions

try to upload files bigger than memory_limit

Specifically from #35360

  • setup plain joomla4 instance at php 8.0 or 7.3 or 7.4 with mysql 5.7
  • keep standard setup values for uploads
  • set server memory_limit to -1 (=no limit)
  • upload an image via Menu -> Content -> Media

Actual result BEFORE applying this Pull Request

File uploads would fail if larger than memory_limit or if ini_get('memory_limit) === -1

Expected result AFTER applying this Pull Request

File Uploaded, even larger than memory_limit upload without issue.

Documentation Changes Required

@laoneo

avatar PhilETaylor PhilETaylor - change - 27 Aug 2021
Status New Pending
avatar PhilETaylor PhilETaylor - open - 27 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 27 Aug 2021
Category Administration com_media
avatar PhilETaylor PhilETaylor - change - 27 Aug 2021
Title
Closes #35360 - Remove check for memory_limit when uploading files
[4] Remove check for memory_limit when uploading files
avatar PhilETaylor PhilETaylor - edited - 27 Aug 2021
avatar PhilETaylor PhilETaylor - change - 27 Aug 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 27 Aug 2021
avatar brianteeman
brianteeman - comment - 27 Aug 2021

/me confused memory_limit is used in the installer as well

avatar PhilETaylor
PhilETaylor - comment - 27 Aug 2021

You mean in com_installer?

$memory_limit = $this->return_bytes(ini_get('memory_limit'));

which just shows warnings if your setting is below the default 32M like something like 16M or 24M (assuming the comments are correct)? If your server is running with memory_limit 16M then I would change web hosts.

avatar HLeithner
HLeithner - comment - 27 Aug 2021

-I would expect reason to limit it is prevent error messages for code like $x = file_get_contents() but that code should shouldn't exists if you expect files lager then 1 mb

avatar PhilETaylor
PhilETaylor - comment - 27 Aug 2021

Im not here to teach everyone about PHP basics. Sorry I dont have time for that.

dont take my word for it. Do your own research.

file_get_contents is not used to "upload files" over http in com_media or com_installer, and there is (or should never be) anywhere in Joomla where we are trying to load the full content of huge files into memory.

All this chat is unrelated to this PR and the problem it resolves.

avatar PhilETaylor PhilETaylor - change - 27 Aug 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 27 Aug 2021
avatar chmst
chmst - comment - 31 Jan 2022

@PhilETaylor could you please resolve conflicts?

avatar PhilETaylor
PhilETaylor - comment - 31 Jan 2022

Closing as has no chance or being merged

Add a Comment

Login with GitHub to post a comment