Changes between Initial Version and Version 1 of Ticket #24558
- Timestamp:
- 06/11/2013 06:51:58 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24558 – Description
initial v1 1 1 if ini_get( 'post_max_size' ) returns 0 then there the post size is unlimited. WP treats this as if the max size is 0 bytes. a quick fix is in wp-includes/media.php : update function wp_max_upload_size() as follows: 2 2 3 { 3 {{{ 4 4 $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) ); 5 5 $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ); … … 7 7 $bytes = apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes ); 8 8 return $bytes; 9 } 9 }}} 10 10 11 11 This is dirty code but does the job - I feel the proper place for the fix is behind the upload_size_limit filter but I don't know enough about WP to provide a proper patch. However, by setting post_max_size=0 and testing this code you should be able to reproduce the bug easily.