WordPress.org

Make WordPress Core

Ticket #31952: 31952.patch

File 31952.patch, 619 bytes (added by brocheafoin, 5 years ago)

Disables file editing in admin unless DISALLOW_FILE_EDIT is defined and false

  • src/wp-includes/capabilities.php

     
    12791279        case 'edit_plugins':
    12801280        case 'edit_themes':
    12811281                // Disallow the file editors.
    1282                 if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
     1282                if ( !defined( 'DISALLOW_FILE_EDIT' ) || ( defined( 'DISALLOW_FILE_EDIT' ) && false != DISALLOW_FILE_EDIT ) )
    12831283                        $caps[] = 'do_not_allow';
    12841284                elseif ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
    12851285                        $caps[] = 'do_not_allow';