WordPress.org

Make WordPress Core

Changeset 36338


Ignore:
Timestamp:
01/17/2016 11:58:04 PM (4 years ago)
Author:
ericlewis
Message:

Themes: Only users with proper capability should see theme errors.

After [36335], if a template file is not loaded, an error is displayed
to logged-in users. As logged-in users may have no capabilities,
this check is insubstantial. Limit the display of this error to users
with the install_themes capability, i.e. someone who has the capacity
to deal with the error.

See #21931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/template-loader.php

    r36335 r36338  
    8787    if ( $template = apply_filters( 'template_include', $template ) ) {
    8888        include( $template );
    89     } elseif ( is_user_logged_in() ) {
     89    } elseif ( current_user_can( 'install_themes' ) ) {
    9090        $theme = wp_get_theme();
    9191        if ( $theme->errors() ) {
Note: See TracChangeset for help on using the changeset viewer.