Ticket #46038: 46038.2.diff
File 46038.2.diff, 3.2 KB (added by , 6 years ago) |
---|
-
src/wp-includes/class-wp-shutdown-handler.php
136 136 $php_error_pluggable = WP_CONTENT_DIR . '/php-error.php'; 137 137 if ( is_readable( $php_error_pluggable ) ) { 138 138 require_once $php_error_pluggable; 139 die();139 return; 140 140 } 141 141 } 142 142 … … 166 166 167 167 $message = __( 'The site is experiencing technical difficulties.' ); 168 168 169 $args = array( 'response' => 500 ); 169 $args = array( 170 'response' => 500, 171 'exit' => false, 172 ); 170 173 if ( function_exists( 'admin_url' ) ) { 171 174 $args['link_url'] = admin_url(); 172 175 $args['link_text'] = __( 'Log into the admin backend to fix this.' ); -
src/wp-includes/functions.php
2957 2957 * Default is the value of is_rtl(). 2958 2958 * @type string $code Error code to use. Default is 'wp_die', or the main error code if $message 2959 2959 * is a WP_Error. 2960 * @type bool $exit Whether to exit the process after completion. Default true. 2960 2961 * } 2961 2962 */ 2962 2963 function wp_die( $message = '', $title = '', $args = array() ) { … … 3201 3202 </body> 3202 3203 </html> 3203 3204 <?php 3204 die(); 3205 if ( $r['exit'] ) { 3206 die(); 3207 } 3205 3208 } 3206 3209 3207 3210 /** … … 3236 3239 } 3237 3240 3238 3241 echo wp_json_encode( $data ); 3239 die(); 3242 if ( $r['exit'] ) { 3243 die(); 3244 } 3240 3245 } 3241 3246 3242 3247 /** … … 3262 3267 $error = new IXR_Error( $r['response'], $message ); 3263 3268 $wp_xmlrpc_server->output( $error->getXml() ); 3264 3269 } 3265 die(); 3270 if ( $r['exit'] ) { 3271 die(); 3272 } 3266 3273 } 3267 3274 3268 3275 /** … … 3291 3298 } 3292 3299 3293 3300 if ( is_scalar( $message ) ) { 3294 die( (string) $message ); 3301 $message = (string) $message; 3302 } else { 3303 $message = '0'; 3295 3304 } 3296 die( '0' ); 3305 3306 if ( $r['exit'] ) { 3307 die( $message ); 3308 } else { 3309 echo $message; 3310 } 3297 3311 } 3298 3312 3299 3313 /** … … 3302 3316 * This is the handler for wp_die when processing APP requests. 3303 3317 * 3304 3318 * @since 3.4.0 3319 * @since 5.1.0 Added the $title and $args parameters. 3305 3320 * @access private 3306 3321 * 3307 * @param string $message Optional. Response to print. Default empty. 3322 * @param string $message Optional. Response to print. Default empty. 3323 * @param string $title Optional. Error title (unused). Default empty. 3324 * @param string|array $args Optional. Arguments to control behavior. Default empty array. 3308 3325 */ 3309 function _scalar_wp_die_handler( $message = '' ) { 3326 function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) { 3327 list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args ); 3328 3329 if ( $r['exit'] ) { 3330 if ( is_scalar( $message ) ) { 3331 die( (string) $message ); 3332 } 3333 die(); 3334 } 3335 3310 3336 if ( is_scalar( $message ) ) { 3311 die( (string) $message );3337 echo (string) $message; 3312 3338 } 3313 die();3314 3339 } 3315 3340 3316 3341 /** … … 3328 3353 $defaults = array( 3329 3354 'response' => 0, 3330 3355 'code' => '', 3356 'exit' => true, 3331 3357 'back_link' => false, 3332 3358 'link_url' => '', 3333 3359 'link_text' => '',