WordPress.org

Make WordPress Core

Changeset 11863


Ignore:
Timestamp:
08/21/09 12:03:02 (5 years ago)
Author:
azaozz
Message:

Show correct max upload filesize error message, props dd32, fixes #10495

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r11858 r11863  
    188188 
    189189    $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20090818'); 
     190    $max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) < (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post; 
     191    if ( empty($max_upload_size) ) 
     192        $max_upload_size = __('not configured'); 
    190193    // these error messages came from the sample swfupload js, they might need changing. 
    191194    $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array( 
    192195            'queue_limit_exceeded' => __('You have attempted to queue too many files.'), 
    193             'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')), 
     196            'file_exceeds_size_limit' => sprintf( __('This file is too big. The maximum upload size for your server is %s.'), $max_upload_size ), 
    194197            'zero_byte_file' => __('This file is empty. Please try another.'), 
    195198            'invalid_filetype' => __('This file type is not allowed. Please try another.'), 
Note: See TracChangeset for help on using the changeset viewer.