Make WordPress Core


Ignore:
Timestamp:
01/30/2019 11:00:30 AM (6 years ago)
Author:
flixos90
Message:

Bootstrap/Load: Revert fatal error recovery mechanism from 5.1 to polish for 5.2.

Due to the high number of follow-up tickets and associated security concerns, it was decided to reschedule the fatal error recovery feature for WordPress 5.2, in order to address these issues properly. The feature will continue to be developed, with iterations being merged into trunk early in the 5.2 release cycle.

Fixes #46141. See #44458, #45932, #45940, #46038, #46047, #46068.

File:
1 edited

Legend:

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

    r44524 r44717  
    3333        switch_theme( $theme->get_stylesheet() );
    3434        wp_redirect( admin_url( 'themes.php?activated=true' ) );
    35         exit;
    36     } elseif ( 'resume' === $_GET['action'] ) {
    37         check_admin_referer( 'resume-theme_' . $_GET['stylesheet'] );
    38         $theme = wp_get_theme( $_GET['stylesheet'] );
    39 
    40         if ( ! current_user_can( 'resume_themes' ) ) {
    41             wp_die(
    42                 '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
    43                 '<p>' . __( 'Sorry, you are not allowed to resume this theme.' ) . '</p>',
    44                 403
    45             );
    46         }
    47 
    48         $result = resume_theme( $theme->get_stylesheet() );
    49 
    50         if ( is_wp_error( $result ) ) {
    51             wp_die( $result );
    52         }
    53 
    54         wp_redirect( admin_url( 'themes.php?resumed=true' ) );
    5535        exit;
    5636    } elseif ( 'delete' == $_GET['action'] ) {
     
    216196    <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
    217197    <?php
    218 } elseif ( isset( $_GET['resumed'] ) ) {
    219     ?>
    220     <div id="message5" class="updated notice is-dismissible"><p><?php _e( 'Theme resumed.' ); ?></p></div>
    221     <?php
    222198}
    223199
     
    373349
    374350    <?php
    375     $can_resume  = current_user_can( 'resume_themes' );
    376351    $can_delete  = current_user_can( 'delete_themes' );
    377352    $can_install = current_user_can( 'install_themes' );
     
    381356        <th><?php _ex( 'Name', 'theme name' ); ?></th>
    382357        <th><?php _e( 'Description' ); ?></th>
    383         <?php if ( $can_resume ) { ?>
    384             <td></td>
    385         <?php } ?>
    386358        <?php if ( $can_delete ) { ?>
    387359            <td></td>
     
    396368            <td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
    397369            <?php
    398             if ( $can_resume ) {
    399                 if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) {
    400                     $stylesheet = $broken_theme->get_stylesheet();
    401                     $resume_url = add_query_arg(
    402                         array(
    403                             'action'     => 'resume',
    404                             'stylesheet' => urlencode( $stylesheet ),
    405                         ),
    406                         admin_url( 'themes.php' )
    407                     );
    408                     $resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet );
    409                     ?>
    410                     <td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td>
    411                     <?php
    412                 } else {
    413                     ?>
    414                     <td></td>
    415                     <?php
    416                 }
    417             }
    418 
    419370            if ( $can_delete ) {
    420371                $stylesheet = $broken_theme->get_stylesheet();
Note: See TracChangeset for help on using the changeset viewer.