[wp-trac] [WordPress Trac] #55926: Fatal error after entered the empty value for 'Max upload file size' in wordpress network
WordPress Trac
noreply at wordpress.org
Mon Jun 6 16:08:22 UTC 2022
#55926: Fatal error after entered the empty value for 'Max upload file size' in
wordpress network
-------------------------------------+-------------------------------------
Reporter: mjkhajeh | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.1
Component: Networks and Sites | Version:
Severity: critical | Resolution:
Keywords: has-patch php8 needs- | Focuses: administration,
refresh needs-unit-tests | multisite
-------------------------------------+-------------------------------------
Changes (by SergeyBiryukov):
* keywords: has-patch php8 needs-refresh => has-patch php8 needs-refresh
needs-unit-tests
Comment:
Hi there, thanks for the ticket and the PR!
I'm not sure adding a default value for `fileupload_maxk` on Network
Settings screen is the right approach here:
* It's not quite clear why of 20+ settings on that page, only one has a
default value.
* The current PR, unless I'm missing something, would always save the 1500
value instead of the entered value.
I think a better solution would be to sanitize `fileupload_maxk` with
`absint()` in `sanitize_option()`, like we already do for other numeric
options, see [attachment:55926.diff]. That would replace an empty value
with zero, which seems to match the intention of entering an empty value
in the first place.
Since `upload_size_limit_filter()` is the function that throws a fatal
error here, a unit test for it would also be great.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55926#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list