WordPress.org

Make WordPress Core

Ticket #4136: 4136.diff

File 4136.diff, 2.2 KB (added by rob1n, 11 years ago)

Refreshed patch refreshed. (fixed typo)

  • wp-includes/version.php

     
    33// This holds the version number in a separate file so we can bump it without cluttering the SVN
    44
    55$wp_version = '2.3-alpha';
    6 $wp_db_version = 5183;
     6$wp_db_version = 5200;
    77
    88?>
  • wp-admin/upgrade-functions.php

     
    184184
    185185        if ( $wp_current_db_version < 4351 )
    186186                upgrade_old_slugs();
     187       
     188        if ( $wp_current_db_version < 5200 ) {
     189                upgrade_230();
     190        }
    187191
    188192        $wp_rewrite->flush_rules();
    189193
     
    565569        }
    566570}
    567571
     572function upgrade_230() {
     573        global $wp_current_db_version;
     574       
     575        if ( $wp_current_db_version < 5200 ) {
     576                populate_roles_230();
     577        }
     578}
     579
    568580function upgrade_old_slugs() {
    569581        // upgrade people who were using the Redirect Old Slugs plugin
    570582        global $wpdb;
  • wp-admin/admin-functions.php

     
    19481948                return $upload_error_handler( $file, __( 'Specified file failed upload test.' ));
    19491949
    19501950        // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
    1951         if ( $test_type ) {
     1951        if ( $test_type && !current_user_can( 'unfiltered_upload' ) ) {
    19521952                $wp_filetype = wp_check_filetype( $file['name'], $mimes );
    19531953
    19541954                extract( $wp_filetype );
  • wp-admin/upgrade-schema.php

     
    262262function populate_roles() {
    263263        populate_roles_160();
    264264        populate_roles_210();
     265        populate_roles_230();
    265266}
    266267
    267268function populate_roles_160() {
     
    395396        }
    396397}
    397398
     399function populate_roles_230() {
     400        $role = get_role( 'administrator' );
     401       
     402        if ( !empty( $role ) ) {
     403                $role->add_cap( 'unfiltered_upload' );
     404        }
     405}
     406
    398407?>
     408 No newline at end of file