[wp-trac] [WordPress Trac] #10495: swfupload file_exceeds_size_limit fails to take into consideration PHP's post_max_size
WordPress Trac
wp-trac at lists.automattic.com
Mon Jul 27 12:21:43 UTC 2009
#10495: swfupload file_exceeds_size_limit fails to take into consideration PHP's
post_max_size
--------------------------+-------------------------------------------------
Reporter: dd32 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: Upload | Version: 2.9
Severity: normal | Keywords: dev-feedback 2nd-opinion
--------------------------+-------------------------------------------------
swfupload file_exceeds_size_limit's localisation string fails to take into
consideration PHP's post_max_size ini setting, which may be smaller than
upload_max_filesize on badly configured servers.
The result for example, for this config:
{{{
upload_max_filesize = 8M
post_max_size = 2M
}}}
with a filesize of 4M - Result: "This file is too big. Your php.ini
upload_max_filesize is 8M."
changing http://core.trac.wordpress.org/browser/trunk/wp-includes/script-
loader.php#L193
from
{{{
sprintf(__('This file is too big. Your php.ini upload_max_filesize is
%s.'), @ini_get('upload_max_filesize')),
}}}
to
{{{
sprintf(__('This file is too big. Your php.ini upload_max_filesize is
%s.'), min(@ini_get('upload_max_filesize'), @ini_get('post_max_size')) ),
}}}
might be a workable solution..
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10495>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list