Make WordPress Core

Ticket #46418: 46418.diff

File 46418.diff, 23.1 KB (added by whyisjake, 5 years ago)
  • src/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' );
  • src/wp-admin/admin-footer.php

     
    88
    99// Don't load directly.
    1010if ( ! defined( 'ABSPATH' ) ) {
    11         die( '-1' );
     11        wp_die( '-1' );
    1212}
    1313
    1414/**
  • src/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' ) ) {
  • src/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';
  • src/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/**
  • src/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/**
  • src/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">
  • src/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 ) ) {
  • src/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.
  • src/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';
  • src/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
  • src/wp-admin/includes/class-wp-site-health.php

     
    228228
    229229                echo ( has_filter( 'wp_version_check', 'wp_version_check' ) ? 'yes' : 'no' );
    230230
    231                 die();
     231                wp_die();
    232232        }
    233233
    234234        /**
  • src/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;
  • src/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">';
  • src/wp-admin/install.php

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

     
    77 */
    88
    99if ( ! defined( 'ABSPATH' ) ) {
    10         die();
     10        wp_die();
    1111}
    1212
    1313/**
  • src/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/**
  • src/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 ) {
  • src/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}
  • src/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();
  • src/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;
  • src/wp-includes/canonical.php

     
    462462                                        $redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] );
    463463
    464464                                        wp_redirect( $redirect_url, 301 );
    465                                         die();
     465                                        wp_die();
    466466                                }
    467467                        }
    468468
     
    521521                        }
    522522
    523523                        wp_redirect( $redirect_url, 301 );
    524                         die();
     524                        wp_die();
    525525                }
    526526        }
    527527
     
    755755                        exit;
    756756                } else {
    757757                        // Debug.
    758                         // die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) );
     758                        // wp_die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) );
    759759                        return;
    760760                }
    761761        } else {
  • src/wp-includes/class-simplepie.php

     
    703703                if (version_compare(PHP_VERSION, '5.6', '<'))
    704704                {
    705705                        trigger_error('Please upgrade to PHP 5.6 or newer.');
    706                         die();
     706                        wp_die();
    707707                }
    708708
    709709                // Other objects, instances created here so we can set options on them
  • src/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}
  • src/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        /**
  • src/wp-includes/comment.php

     
    723723                        return new WP_Error( 'comment_duplicate', $comment_duplicate_message, 409 );
    724724                } else {
    725725                        if ( wp_doing_ajax() ) {
    726                                 die( $comment_duplicate_message );
     726                                wp_die( $comment_duplicate_message );
    727727                        }
    728728
    729729                        wp_die( $comment_duplicate_message, 409 );
     
    742742         * @param string $comment_author_email Comment author's email.
    743743         * @param string $comment_date_gmt     GMT date the comment was posted.
    744744         * @param bool   $avoid_die            Whether to prevent executing wp_die()
    745          *                                     or die() if a comment flood is occurring.
     745         *                                     or wp_die() if a comment flood is occurring.
    746746         */
    747747        do_action(
    748748                'check_comment_flood',
     
    764764         * @param string $comment_author_email Comment author's email.
    765765         * @param string $comment_date_gmt     GMT date the comment was posted.
    766766         * @param bool   $avoid_die            Whether to prevent executing wp_die()
    767          *                                     or die() if a comment flood is occurring.
     767         *                                     or wp_die() if a comment flood is occurring.
    768768         */
    769769        $is_flood = apply_filters(
    770770                'wp_is_comment_flood',
     
    937937                                $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );
    938938
    939939                                if ( wp_doing_ajax() ) {
    940                                         die( $comment_flood_message );
     940                                        wp_die( $comment_flood_message );
    941941                                }
    942942
    943943                                wp_die( $comment_flood_message, 429 );
  • src/wp-includes/embed.php

     
    734734
    735735        if ( ! class_exists( 'SimpleXMLElement' ) ) {
    736736                status_header( 501 );
    737                 die( get_status_header_desc( 501 ) );
     737                wp_die( get_status_header_desc( 501 ) );
    738738        }
    739739
    740740        $result = _oembed_create_xml( $data );
  • src/wp-includes/functions.php

     
    35573557</html>
    35583558        <?php
    35593559        if ( $parsed_args['exit'] ) {
    3560                 die();
     3560                wp_die();
    35613561        }
    35623562}
    35633563
     
    35973597        }
    35983598
    35993599        if ( $parsed_args['exit'] ) {
    3600                 die( $message );
     3600                wp_die( $message );
    36013601        }
    36023602
    36033603        echo $message;
     
    36373637
    36383638        echo wp_json_encode( $data );
    36393639        if ( $parsed_args['exit'] ) {
    3640                 die();
     3640                wp_die();
    36413641        }
    36423642}
    36433643
     
    36793679        $jsonp_callback = $_GET['_jsonp'];
    36803680        echo '/**/' . $jsonp_callback . '(' . $result . ')';
    36813681        if ( $parsed_args['exit'] ) {
    3682                 die();
     3682                wp_die();
    36833683        }
    36843684}
    36853685
     
    37113711                $wp_xmlrpc_server->output( $error->getXml() );
    37123712        }
    37133713        if ( $parsed_args['exit'] ) {
    3714                 die();
     3714                wp_die();
    37153715        }
    37163716}
    37173717
     
    37553755
    37563756        echo $xml;
    37573757        if ( $parsed_args['exit'] ) {
    3758                 die();
     3758                wp_die();
    37593759        }
    37603760}
    37613761
     
    37773777
    37783778        if ( $parsed_args['exit'] ) {
    37793779                if ( is_scalar( $message ) ) {
    3780                         die( (string) $message );
     3780                        wp_die( (string) $message );
    37813781                }
    3782                 die();
     3782                wp_die();
    37833783        }
    37843784
    37853785        if ( is_scalar( $message ) ) {
     
    46544654        // Load custom DB error template, if present.
    46554655        if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
    46564656                require_once WP_CONTENT_DIR . '/db-error.php';
    4657                 die();
     4657                wp_die();
    46584658        }
    46594659
    46604660        // If installing or in the admin, provide the verbose message.
  • src/wp-includes/load.php

     
    160160
    161161        if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
    162162                require_once WP_CONTENT_DIR . '/maintenance.php';
    163                 die();
     163                wp_die();
    164164        }
    165165
    166166        require_once ABSPATH . WPINC . '/functions.php';
     
    602602                $link = wp_guess_url() . '/wp-admin/install.php';
    603603
    604604                wp_redirect( $link );
    605                 die();
     605                wp_die();
    606606        }
    607607}
    608608
     
    14491449                        )
    14501450                );
    14511451                echo "###### wp_scraping_result_end:$key ######";
    1452                 die();
     1452                wp_die();
    14531453        }
    14541454        if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
    14551455                define( 'WP_SANDBOX_SCRAPING', true );
  • src/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
  • src/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 );
  • src/wp-includes/pluggable.php

     
    11421142
    11431143                if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) {
    11441144                        wp_nonce_ays( $action );
    1145                         die();
     1145                        wp_die();
    11461146                }
    11471147
    11481148                return $result;
     
    11971197                        if ( wp_doing_ajax() ) {
    11981198                                wp_die( -1, 403 );
    11991199                        } else {
    1200                                 die( '-1' );
     1200                                wp_die( '-1' );
    12011201                        }
    12021202                }
    12031203
  • src/wp-includes/rest-api.php

     
    312312        $server->serve_request( $route );
    313313
    314314        // We're done.
    315         die();
     315        wp_die();
    316316}
    317317
    318318/**
  • src/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() ) { ?>
  • src/wp-includes/wp-db.php

     
    16751675                        // Load custom DB error template, if present.
    16761676                        if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
    16771677                                require_once WP_CONTENT_DIR . '/db-error.php';
    1678                                 die();
     1678                                wp_die();
    16791679                        }
    16801680
    16811681                        $message = '<h1>' . __( 'Error establishing a database connection' ) . "</h1>\n";
  • src/wp-settings.php

     
    542542        $file = ms_site_check();
    543543        if ( true !== $file ) {
    544544                require $file;
    545                 die();
     545                wp_die();
    546546        }
    547547        unset( $file );
    548548}
  • src/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();
  • src/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.