WordPress.org

Make WordPress Core

Changeset 5303


Ignore:
Timestamp:
04/24/2007 11:27:20 PM (15 years ago)
Author:
rob1n
Message:

Add unfiltered_upload cap, and allow for admins. Props Nazgul. fixes #4136

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r5259 r5303  
    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
  • trunk/wp-admin/upgrade-functions.php

    r5093 r5303  
    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();
     
    563567        // Obsolete linkcategories table
    564568        $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories');
     569    }
     570}
     571
     572function upgrade_230() {
     573    global $wp_current_db_version;
     574   
     575    if ( $wp_current_db_version < 5200 ) {
     576        populate_roles_230();
    565577    }
    566578}
  • trunk/wp-admin/upgrade-schema.php

    r5184 r5303  
    263263    populate_roles_160();
    264264    populate_roles_210();
     265    populate_roles_230();
    265266}
    266267
     
    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?>
  • trunk/wp-includes/version.php

    r5288 r5303  
    44
    55$wp_version = '2.3-alpha';
    6 $wp_db_version = 5183;
     6$wp_db_version = 5200;
    77
    88?>
Note: See TracChangeset for help on using the changeset viewer.