Make WordPress Core

Ticket #27224: 27224.2.diff

File 27224.2.diff, 1.3 KB (added by bogdand, 10 years ago)

fixed step incrementation

  • src/wp-admin/network/settings.php

    diff --git src/wp-admin/network/settings.php src/wp-admin/network/settings.php
    index 1736511..855ffa0 100644
    if ( $_POST ) { 
    6161        foreach ( $options as $option_name ) {
    6262                if ( ! isset($_POST[$option_name]) )
    6363                        continue;
    64                 $value = wp_unslash( $_POST[$option_name] );
     64                if ( $option_name == 'fileupload_maxk' ) {
     65                        $value = (float)wp_unslash($_POST[$option_name]) * 1024;
     66                }
     67                else {
     68                        $value = wp_unslash( $_POST[$option_name] );
     69                }
    6570                update_site_option( $option_name, $value );
    6671        }
    6772
    if ( isset( $_GET['updated'] ) ) { 
    269274
    270275                        <tr>
    271276                                <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
    272                                 <td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?></td>
     277                                <td><?php printf( _x( '%s MB', 'File size in MB' ), '<input name="fileupload_maxk" type="number" min="0" step="1" style="width: 100px" id="fileupload_maxk" value="' . round( esc_attr( get_site_option( 'fileupload_maxk', 300 )/1024 ), 2) . '" />' ); ?></td>
    273278                        </tr>
    274279                </table>
    275280