Allow wp_die() to die in plain text when running the test suite.

Props jorbin.
Fixes #27749.


git-svn-id: https://develop.svn.wordpress.org/trunk@28797 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-06-21 19:59:28 +00:00
parent ce3248c482
commit 5c48c4f8a8
3 changed files with 38 additions and 23 deletions

View File

@@ -302,27 +302,6 @@ function mask_input_value($in, $name='_wpnonce') {
return preg_replace('@<input([^>]*) name="'.preg_quote($name).'"([^>]*) value="[^>]*" />@', '<input$1 name="'.preg_quote($name).'"$2 value="***" />', $in);
}
$GLOBALS['_wp_die_disabled'] = false;
function _wp_die_handler( $message, $title = '', $args = array() ) {
if ( !$GLOBALS['_wp_die_disabled'] ) {
_default_wp_die_handler( $message, $title, $args );
} else {
//Ignore at our peril
}
}
function _disable_wp_die() {
$GLOBALS['_wp_die_disabled'] = true;
}
function _enable_wp_die() {
$GLOBALS['_wp_die_disabled'] = false;
}
function _wp_die_handler_filter() {
return '_wp_die_handler';
}
if ( !function_exists( 'str_getcsv' ) ) {
function str_getcsv( $input, $delimiter = ',', $enclosure = '"', $escape = "\\" ) {
$fp = fopen( 'php://temp/', 'r+' );