From 15e5d9169212f201bc27aef65df4bd4919fcac17 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 25 Jan 2010 22:09:43 +0000 Subject: [PATCH] Deprecate graceful_fail(). see #11644 git-svn-id: https://develop.svn.wordpress.org/trunk@12827 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 2 +- wp-includes/ms-deprecated.php | 35 +++++++++++++++++++++++++++++++++++ wp-includes/ms-functions.php | 31 ------------------------------- wp-includes/ms-load.php | 20 +++++++++----------- 4 files changed, 45 insertions(+), 43 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 0203ff22f7..f9937f969a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2504,7 +2504,7 @@ function wp_die( $message, $title = '', $args = array() ) { * * @since 3.0.0 * @private - * + * * @param string $message Error message. * @param string $title Error title. * @param string|array $args Optional arguements to control behaviour. diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index 885e6fb96c..b35260349f 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -56,4 +56,39 @@ function is_site_admin( $user_login = '' ) { return is_super_admin( $user_id ); } +if ( !function_exists('graceful_fail') ) : +/** + * @deprecated 3.0 + */ +function graceful_fail( $message ) { + _deprecated_function( __FUNCTION__, '3.0', 'wp_die()' ); + $message = apply_filters('graceful_fail', $message); + $message_template = apply_filters( 'graceful_fail_template', +' + + +Error! + + + +

%s

+ +' ); + die( sprintf( $message_template, $message ) ); +} +endif; + ?> \ No newline at end of file diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 0ea1c40ae5..54cec94d76 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1766,37 +1766,6 @@ function fix_import_form_size( $size ) { return $size; // default } -if ( !function_exists('graceful_fail') ) : -function graceful_fail( $message ) { - $message = apply_filters('graceful_fail', $message); - $message_template = apply_filters( 'graceful_fail_template', -' - - -Error! - - - -

%s

- -' ); - die( sprintf( $message_template, $message ) ); -} -endif; - /* Delete blog */ class delete_blog { function delete_blog() { diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index de6f2a6b0f..98fd77839b 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -91,26 +91,24 @@ function ms_site_check() { return WP_CONTENT_DIR . '/blog-deleted.php'; } else { header('HTTP/1.1 410 Gone'); - graceful_fail(__('This user has elected to delete their account and the content is no longer available.')); + wp_die(__('This user has elected to delete their account and the content is no longer available.')); } + } elseif ( '2' == $current_blog->deleted ) { + if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) + return WP_CONTENT_DIR . '/blog-inactive.php'; + else + wp_die( sprintf( __( 'This blog has not been activated yet. If you are having problems activating your blog, please contact %1$s.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) ); } - if ( '2' == $current_blog->deleted ) { - if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) { - return WP_CONTENT_DIR . '/blog-inactive.php'; - } else { - graceful_fail( sprintf( __( 'This blog has not been activated yet. If you are having problems activating your blog, please contact %1$s.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) ); - } - } - - if( $current_blog->archived == '1' || $current_blog->spam == '1' ) { + if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) { if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) { return WP_CONTENT_DIR . '/blog-suspended.php'; } else { header('HTTP/1.1 410 Gone'); - graceful_fail(__('This blog has been archived or suspended.')); + wp_die(__('This blog has been archived or suspended.')); } } + return true; }