WordPress Max Upload Bug
-
Hello all,
I am running the latest version of WordPress on PHP8 as a multisite installation. I noticed on all of the file upload boxes, the max number of bytes was displaying as 0 bytes. The PHP max_upload_size and max_post_body size were both set to 64M. I traced the ‘upload_size_limit’ filter back to the wp_max_upload_size function and think there is an error in its return value;function wp_max_upload_size() { $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) ); $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ); /** * Filters the maximum upload size allowed in php.ini. * * @since 2.5.0 * * @param int $size Max upload size limit in bytes. * @param int $u_bytes Maximum upload filesize in bytes. * @param int $p_bytes Maximum size of POST data in bytes. */ return apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), /* $u_bytes, $p_bytes*/ ); }
Since the upload_size_limit_filter function in ms-functions.php only accepts $size as an arg, I don’t think $u_bytes and $p_bytes should be passed. When I commented those out as above, everything worked fine.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WordPress Max Upload Bug’ is closed to new replies.