Make WordPress Core

Ticket #46418: 46418.5.diff

File 46418.5.diff, 21.6 KB (added by immeet94, 5 years ago)
  • wp-activate.php

     
    1515
    1616if ( ! is_multisite() ) {
    1717        wp_redirect( wp_registration_url() );
    18         die();
     18        wp_die();
    1919}
    2020
    2121$valid_error_codes = array( 'already_active', 'blog_taken' );
  • wp-admin/admin-footer.php

     
    88
    99// Don't load directly.
    1010if ( ! defined( 'ABSPATH' ) ) {
    11         die( '-1' );
     11        wp_die( '-1' );
    1212}
    1313
    1414/**
  • wp-admin/async-upload.php

     
    3131        nocache_headers();
    3232
    3333        wp_ajax_upload_attachment();
    34         die( '0' );
     34        wp_die( '0' );
    3535}
    3636
    3737if ( ! current_user_can( 'upload_files' ) ) {
  • wp-admin/comment.php

     
    9292                $comment = get_comment( $comment_id );
    9393                if ( ! $comment ) {
    9494                        wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
    95                         die();
     95                        wp_die();
    9696                }
    9797
    9898                if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
    9999                        wp_redirect( admin_url( 'edit-comments.php?error=2' ) );
    100                         die();
     100                        wp_die();
    101101                }
    102102
    103103                // No need to re-approve/re-trash/re-spam a comment.
    104104                if ( str_replace( '1', 'approve', $comment->comment_approved ) == $action ) {
    105105                        wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
    106                         die();
     106                        wp_die();
    107107                }
    108108
    109109                require_once ABSPATH . 'wp-admin/admin-header.php';
  • wp-admin/edit-form-advanced.php

     
    88
    99// Don't load directly.
    1010if ( ! defined( 'ABSPATH' ) ) {
    11         die( '-1' );
     11        wp_die( '-1' );
    1212}
    1313
    1414/**
  • wp-admin/edit-form-blocks.php

     
    1010
    1111// Don't load directly.
    1212if ( ! defined( 'ABSPATH' ) ) {
    13         die( '-1' );
     13        wp_die( '-1' );
    1414}
    1515
    1616/**
  • wp-admin/edit-form-comment.php

     
    88
    99// Don't load directly.
    1010if ( ! defined( 'ABSPATH' ) ) {
    11         die( '-1' );
     11        wp_die( '-1' );
    1212}
    1313?>
    1414<form name="post" action="comment.php" method="post" id="post">
  • wp-admin/edit-link-form.php

     
    88
    99// Don't load directly.
    1010if ( ! defined( 'ABSPATH' ) ) {
    11         die( '-1' );
     11        wp_die( '-1' );
    1212}
    1313
    1414if ( ! empty( $link_id ) ) {
  • wp-admin/edit-tag-form.php

     
    88
    99// Don't load directly.
    1010if ( ! defined( 'ABSPATH' ) ) {
    11         die( '-1' );
     11        wp_die( '-1' );
    1212}
    1313
    1414// Back compat hooks.
  • wp-admin/export.php

     
    119119        $args = apply_filters( 'export_args', $args );
    120120
    121121        export_wp( $args );
    122         die();
     122        wp_die();
    123123}
    124124
    125125require_once ABSPATH . 'wp-admin/admin-header.php';
  • wp-admin/includes/class-pclzip.php

     
    218218    // ----- Tests the zlib
    219219    if (!function_exists('gzopen'))
    220220    {
    221       die('Abort '.basename(__FILE__).' : Missing zlib extensions');
     221      wp_die('Abort '.basename(__FILE__).' : Missing zlib extensions');
    222222    }
    223223
    224224    // ----- Set the attributes
  • wp-admin/includes/class-wp-site-health.php

     
    223223
    224224                echo ( has_filter( 'wp_version_check', 'wp_version_check' ) ? 'yes' : 'no' );
    225225
    226                 die();
     226                wp_die();
    227227        }
    228228
    229229        /**
  • wp-admin/includes/image-edit.php

     
    2525        if ( isset( $meta['width'], $meta['height'] ) ) {
    2626                $big = max( $meta['width'], $meta['height'] );
    2727        } else {
    28                 die( __( 'Image data does not exist. Please re-upload the image.' ) );
     28                wp_die( __( 'Image data does not exist. Please re-upload the image.' ) );
    2929        }
    3030
    3131        $sizer = $big > 400 ? 400 / $big : 1;
  • wp-admin/includes/network.php

     
    117117                ) . '</p></div>';
    118118                echo '</div>';
    119119                require_once ABSPATH . 'wp-admin/admin-footer.php';
    120                 die();
     120                wp_die();
    121121        }
    122122
    123123        $active_plugins = get_option( 'active_plugins' );
     
    130130                echo '<p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>';
    131131                echo '</div>';
    132132                require_once ABSPATH . 'wp-admin/admin-footer.php';
    133                 die();
     133                wp_die();
    134134        }
    135135
    136136        $hostname  = get_clean_basedomain();
     
    145145                echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>';
    146146                echo '</div>';
    147147                require_once ABSPATH . 'wp-admin/admin-footer.php';
    148                 die();
     148                wp_die();
    149149        }
    150150
    151151        echo '<form method="post">';
  • wp-admin/install.php

     
    214214// Let's check to make sure WP isn't already installed.
    215215if ( is_blog_installed() ) {
    216216        display_header();
    217         die(
     217        wp_die(
    218218                '<h1>' . __( 'Already Installed' ) . '</h1>' .
    219219                '<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' .
    220220                '<p class="step"><a href="' . esc_url( wp_login_url() ) . '" class="button button-large">' . __( 'Log In' ) . '</a></p>' .
     
    261261
    262262if ( ! $mysql_compat || ! $php_compat ) {
    263263        display_header();
    264         die( '<h1>' . __( 'Requirements Not Met' ) . '</h1><p>' . $compat . '</p></body></html>' );
     264        wp_die( '<h1>' . __( 'Requirements Not Met' ) . '</h1><p>' . $compat . '</p></body></html>' );
    265265}
    266266
    267267if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
    268268        display_header();
    269         die(
     269        wp_die(
    270270                '<h1>' . __( 'Configuration Error' ) . '</h1>' .
    271271                '<p>' . sprintf(
    272272                        /* translators: %s: wp-config.php */
     
    279279// Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install.
    280280if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
    281281        display_header();
    282         die(
     282        wp_die(
    283283                '<h1>' . __( 'Configuration Error' ) . '</h1>' .
    284284                '<p>' . sprintf(
    285285                        /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */
  • wp-admin/link-parse-opml.php

     
    77 */
    88
    99if ( ! defined( 'ABSPATH' ) ) {
    10         die();
     10        wp_die();
    1111}
    1212
    1313/**
  • wp-admin/upgrade.php

     
    3232// Do it. No output.
    3333if ( 'upgrade_db' === $step ) {
    3434        wp_upgrade();
    35         die( '0' );
     35        wp_die( '0' );
    3636}
    3737
    3838/**
  • wp-admin/user-edit.php

     
    106106                wp_update_user( $user );
    107107                delete_user_meta( $current_user->ID, '_new_email' );
    108108                wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );
    109                 die();
     109                wp_die();
    110110        } else {
    111111                wp_redirect( add_query_arg( array( 'error' => 'new-email' ), self_admin_url( 'profile.php' ) ) );
    112112        }
     
    114114        check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
    115115        delete_user_meta( $current_user->ID, '_new_email' );
    116116        wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );
    117         die();
     117        wp_die();
    118118}
    119119
    120120switch ( $action ) {
  • wp-admin/user-new.php

     
    4141                        $user_details = get_user_by( 'login', $user_email );
    4242                } else {
    4343                        wp_redirect( add_query_arg( array( 'update' => 'enter_email' ), 'user-new.php' ) );
    44                         die();
     44                        wp_die();
    4545                }
    4646        }
    4747
    4848        if ( ! $user_details ) {
    4949                wp_redirect( add_query_arg( array( 'update' => 'does_not_exist' ), 'user-new.php' ) );
    50                 die();
     50                wp_die();
    5151        }
    5252
    5353        if ( ! current_user_can( 'promote_user', $user_details->ID ) ) {
     
    147147                }
    148148        }
    149149        wp_redirect( $redirect );
    150         die();
     150        wp_die();
    151151} elseif ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ) {
    152152        check_admin_referer( 'create-user', '_wpnonce_create-user' );
    153153
     
    171171                                $redirect = add_query_arg( 'update', 'add', 'user-new.php' );
    172172                        }
    173173                        wp_redirect( $redirect );
    174                         die();
     174                        wp_die();
    175175                }
    176176        } else {
    177177                // Adding a new user to this site.
     
    214214                                $redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' );
    215215                        }
    216216                        wp_redirect( $redirect );
    217                         die();
     217                        wp_die();
    218218                }
    219219        }
    220220}
  • wp-cron.php

     
    2929}
    3030
    3131if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) {
    32         die();
     32        wp_die();
    3333}
    3434
    3535/**
     
    7878
    7979$crons = wp_get_ready_cron_jobs();
    8080if ( empty( $crons ) ) {
    81         die();
     81        wp_die();
    8282}
    8383
    8484$gmt_time = microtime( true );
     
    149149        delete_transient( 'doing_cron' );
    150150}
    151151
    152 die();
     152wp_die();
  • wp-includes/IXR/class-IXR-server.php

     
    4444                    header( 'Allow: POST' );
    4545                }
    4646                header('Content-Type: text/plain'); // merged from WP #9093
    47                 die('XML-RPC server accepts POST requests only.');
     47                wp_die('XML-RPC server accepts POST requests only.');
    4848            }
    4949
    5050            global $HTTP_RAW_POST_DATA;
  • wp-includes/canonical.php

     
    354354                                if ( isset( $old_feed_files[ basename( $redirect['path'] ) ] ) ) {
    355355                                        $redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] );
    356356                                        wp_redirect( $redirect_url, 301 );
    357                                         die();
     357                                        wp_die();
    358358                                }
    359359                        }
    360360
     
    399399                        }
    400400
    401401                        wp_redirect( $redirect_url, 301 );
    402                         die();
     402                        wp_die();
    403403                }
    404404        }
    405405
     
    616616                        exit();
    617617                } else {
    618618                        // Debug.
    619                         // die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) );
     619                        // wp_die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) );
    620620                        return;
    621621                }
    622622        } else {
  • wp-includes/class-simplepie.php

     
    662662                if (version_compare(PHP_VERSION, '5.2', '<'))
    663663                {
    664664                        trigger_error('PHP 4.x, 5.0 and 5.1 are no longer supported. Please upgrade to PHP 5.2 or newer.');
    665                         die();
     665                        wp_die();
    666666                }
    667667
    668668                // Other objects, instances created here so we can set options on them
  • wp-includes/class-wp-ajax-response.php

     
    157157                if ( wp_doing_ajax() ) {
    158158                        wp_die();
    159159                } else {
    160                         die();
     160                        wp_die();
    161161                }
    162162        }
    163163}
  • wp-includes/class-wp-widget.php

     
    110110         * @param array $instance The settings for the particular instance of the widget.
    111111         */
    112112        public function widget( $args, $instance ) {
    113                 die( 'function WP_Widget::widget() must be overridden in a subclass.' );
     113                wp_die( 'function WP_Widget::widget() must be overridden in a subclass.' );
    114114        }
    115115
    116116        /**
  • wp-includes/comment.php

     
    713713                        return new WP_Error( 'comment_duplicate', $comment_duplicate_message, 409 );
    714714                } else {
    715715                        if ( wp_doing_ajax() ) {
    716                                 die( $comment_duplicate_message );
     716                                wp_die( $comment_duplicate_message );
    717717                        }
    718718
    719719                        wp_die( $comment_duplicate_message, 409 );
     
    732732         * @param string $comment_author_email Comment author's email.
    733733         * @param string $comment_date_gmt     GMT date the comment was posted.
    734734         * @param bool   $avoid_die            Whether to prevent executing wp_die()
    735          *                                     or die() if a comment flood is occurring.
     735         *                                     or wp_die() if a comment flood is occurring.
    736736         */
    737737        do_action(
    738738                'check_comment_flood',
     
    754754         * @param string $comment_author_email Comment author's email.
    755755         * @param string $comment_date_gmt     GMT date the comment was posted.
    756756         * @param bool   $avoid_die            Whether to prevent executing wp_die()
    757          *                                     or die() if a comment flood is occurring.
     757         *                                     or wp_die() if a comment flood is occurring.
    758758         */
    759759        $is_flood = apply_filters(
    760760                'wp_is_comment_flood',
     
    927927                                $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );
    928928
    929929                                if ( wp_doing_ajax() ) {
    930                                         die( $comment_flood_message );
     930                                        wp_die( $comment_flood_message );
    931931                                }
    932932
    933933                                wp_die( $comment_flood_message, 429 );
  • wp-includes/embed.php

     
    735735
    736736        if ( ! class_exists( 'SimpleXMLElement' ) ) {
    737737                status_header( 501 );
    738                 die( get_status_header_desc( 501 ) );
     738                wp_die( get_status_header_desc( 501 ) );
    739739        }
    740740
    741741        $result = _oembed_create_xml( $data );
  • wp-includes/load.php

     
    3232        }
    3333
    3434        if ( isset( $_REQUEST['GLOBALS'] ) ) {
    35                 die( 'GLOBALS overwrite attempt detected' );
     35                wp_die( 'GLOBALS overwrite attempt detected' );
    3636        }
    3737
    3838        // Variables that shouldn't be unset.
     
    217217
    218218        if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
    219219                require_once WP_CONTENT_DIR . '/maintenance.php';
    220                 die();
     220                wp_die();
    221221        }
    222222
    223223        require_once ABSPATH . WPINC . '/functions.php';
     
    612612                $link = wp_guess_url() . '/wp-admin/install.php';
    613613
    614614                wp_redirect( $link );
    615                 die();
     615                wp_die();
    616616        }
    617617}
    618618
     
    14591459                        )
    14601460                );
    14611461                echo "###### wp_scraping_result_end:$key ######";
    1462                 die();
     1462                wp_die();
    14631463        }
    14641464        if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
    14651465                define( 'WP_SANDBOX_SCRAPING', true );
  • wp-includes/ms-deprecated.php

     
    113113<p class="message">%s</p>
    114114</body>
    115115</html>' );
    116         die( sprintf( $message_template, $message ) );
     116        wp_die( sprintf( $message_template, $message ) );
    117117}
    118118endif;
    119119
     
    614614
    615615        $suppress = $wpdb->suppress_errors();
    616616        if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) ) {
    617                 die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );
     617                wp_die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );
    618618        }
    619619        $wpdb->suppress_errors( $suppress );
    620620
  • wp-includes/ms-files.php

     
    1212require_once dirname( __DIR__ ) . '/wp-load.php';
    1313
    1414if ( ! is_multisite() ) {
    15         die( 'Multisite support not enabled' );
     15        wp_die( 'Multisite support not enabled' );
    1616}
    1717
    1818ms_file_constants();
     
    2121
    2222if ( '1' == $current_blog->archived || '1' == $current_blog->spam || '1' == $current_blog->deleted ) {
    2323        status_header( 404 );
    24         die( '404 &#8212; File not found.' );
     24        wp_die( '404 &#8212; File not found.' );
    2525}
    2626
    2727$file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET['file'] );
    2828if ( ! is_file( $file ) ) {
    2929        status_header( 404 );
    30         die( '404 &#8212; File not found.' );
     30        wp_die( '404 &#8212; File not found.' );
    3131}
    3232
    3333$mime = wp_check_filetype( $file );
  • wp-includes/pluggable.php

     
    11371137
    11381138                if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) {
    11391139                        wp_nonce_ays( $action );
    1140                         die();
     1140                        wp_die();
    11411141                }
    11421142
    11431143                return $result;
     
    11921192                        if ( wp_doing_ajax() ) {
    11931193                                wp_die( -1, 403 );
    11941194                        } else {
    1195                                 die( '-1' );
     1195                                wp_die( '-1' );
    11961196                        }
    11971197                }
    11981198
  • wp-includes/rest-api.php

     
    306306        $server->serve_request( $route );
    307307
    308308        // We're done.
    309         die();
     309        wp_die();
    310310}
    311311
    312312/**
  • wp-includes/theme-compat/comments.php

     
    1717
    1818// Do not delete these lines.
    1919if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
    20         die( 'Please do not load this page directly. Thanks!' );
     20        wp_die( 'Please do not load this page directly. Thanks!' );
    2121}
    2222
    2323if ( post_password_required() ) { ?>
  • wp-includes/wp-db.php

     
    16681668                        // Load custom DB error template, if present.
    16691669                        if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
    16701670                                require_once WP_CONTENT_DIR . '/db-error.php';
    1671                                 die();
     1671                                wp_die();
    16721672                        }
    16731673
    16741674                        $message = '<h1>' . __( 'Error establishing a database connection' ) . "</h1>\n";
  • wp-settings.php

     
    544544        $file = ms_site_check();
    545545        if ( true !== $file ) {
    546546                require $file;
    547                 die();
     547                wp_die();
    548548        }
    549549        unset( $file );
    550550}
  • wp-signup.php

     
    1111
    1212if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new'], get_site_option( 'illegal_names' ), true ) ) {
    1313        wp_redirect( network_home_url() );
    14         die();
     14        wp_die();
    1515}
    1616
    1717/**
     
    3131
    3232if ( ! is_multisite() ) {
    3333        wp_redirect( wp_registration_url() );
    34         die();
     34        wp_die();
    3535}
    3636
    3737if ( ! is_main_site() ) {
    3838        wp_redirect( network_site_url( 'wp-signup.php' ) );
    39         die();
     39        wp_die();
    4040}
    4141
    4242// Fix for page title.
     
    409409        global $blogname, $blog_title, $errors, $domain, $path;
    410410        $current_user = wp_get_current_user();
    411411        if ( ! is_user_logged_in() ) {
    412                 die();
     412                wp_die();
    413413        }
    414414
    415415        $result = validate_blog_form();
  • wp-trackback.php

     
    3232                echo "<error>1</error>\n";
    3333                echo "<message>$error_message</message>\n";
    3434                echo '</response>';
    35                 die();
     35                wp_die();
    3636        } else {
    3737                echo '<?xml version="1.0" encoding="utf-8"?' . ">\n";
    3838                echo "<response>\n";
     
    6565
    6666// No valid uses for UTF-7.
    6767if ( false !== strpos( $charset, 'UTF-7' ) ) {
    68         die;
     68        wp_die;
    6969}
    7070
    7171// For international trackbacks.