Make WordPress Core


Ignore:
Timestamp:
06/22/2020 05:24:34 PM (4 years ago)
Author:
desrosj
Message:

General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.

“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the $new_whitelist_options global variable) are removed. A new ticket has been opened to explore renaming the $new_whitelist_options variable (#50434).

Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.

Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.

Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/attachments.php

    r47122 r48121  
    467467        // On Multisite, psd is not an allowed mime type by default.
    468468        if ( is_multisite() ) {
    469             add_filter( 'upload_mimes', array( $this, 'whitelist_psd_mime_type' ), 10, 2 );
     469            add_filter( 'upload_mimes', array( $this, 'allow_psd_mime_type' ), 10, 2 );
    470470        }
    471471
     
    482482
    483483        if ( is_multisite() ) {
    484             remove_filter( 'upload_mimes', array( $this, 'whitelist_psd_mime_type' ), 10, 2 );
     484            remove_filter( 'upload_mimes', array( $this, 'allow_psd_mime_type' ), 10, 2 );
    485485        }
    486486    }
     
    494494        $this->assertFalse( $upload['error'] );
    495495
    496         add_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
    497 
    498         $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
    499 
    500         remove_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
     496        add_filter( 'upload_mimes', array( $this, 'disallow_jpg_mime_type' ) );
     497
     498        $upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
     499
     500        remove_filter( 'upload_mimes', array( $this, 'disallow_jpg_mime_type' ) );
    501501
    502502        $this->assertNotEmpty( $upload['error'] );
    503503    }
    504504
    505     public function whitelist_psd_mime_type( $mimes ) {
     505    public function allow_psd_mime_type( $mimes ) {
    506506        $mimes['psd'] = 'application/octet-stream';
    507507        return $mimes;
    508508    }
    509509
    510     public function blacklist_jpg_mime_type( $mimes ) {
     510    public function disallow_jpg_mime_type( $mimes ) {
    511511        unset( $mimes['jpg|jpeg|jpe'] );
    512512        return $mimes;
Note: See TracChangeset for help on using the changeset viewer.