WordPress.org

Make WordPress Core

Changeset 35017


Ignore:
Timestamp:
10/10/2015 11:17:01 PM (4 years ago)
Author:
jeremyfelt
Message:

MS: Handle the possibility of 0 when checking a user's upload quota.

Upload space of 0 is now more possible via r35016 and should be respected rather than modified to a default of 10MB.

Fixes #34037.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r35013 r35017  
    418418
    419419    $space_allowed = get_space_allowed();
    420     if ( empty( $space_allowed ) || !is_numeric( $space_allowed ) )
     420    if ( ! is_numeric( $space_allowed ) ) {
    421421        $space_allowed = 10; // Default space allowed is 10 MB
    422 
     422    }
    423423    $space_used = get_space_used();
    424424
  • trunk/tests/phpunit/tests/multisite/uploadIsUserOverQuota.php

    r34901 r35017  
    2828    }
    2929
    30     /**
    31      * In this scenario, 10 is set as the spaced allowed when 0 is returned
    32      * by `get_space_allowed()` inside `upload_is_user_over_quota()`.
    33      *
    34      * This is likely not expected behavior.
    35      */
    3630    public function test_upload_is_user_over_quota_allowed_0_used_5() {
    3731        add_filter( 'get_space_allowed', '__return_zero' );
     
    4135        remove_filter( 'pre_get_space_used', array( $this, '_filter_space_5' ) );
    4236
    43         $this->assertFalse( $result );
     37        $this->assertTrue( $result );
    4438    }
    4539
Note: See TracChangeset for help on using the changeset viewer.