Coding Standards: Fix instances of `Generic.WhiteSpace.ArbitraryParenthesesSpacing.FoundEmpty`.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47855


git-svn-id: http://core.svn.wordpress.org/trunk@47631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-05-26 09:37:10 +00:00
parent 235bd98f3c
commit 7b192d406a
29 changed files with 71 additions and 69 deletions

View File

@ -292,7 +292,7 @@ if ( isset( $plugin_page ) ) {
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
} elseif ( isset( $_GET['import'] ) ) {
$importer = $_GET['import'];
@ -353,7 +353,7 @@ if ( isset( $plugin_page ) ) {
// Make sure rules are flushed.
flush_rewrite_rules( false );
exit();
exit;
} else {
/**
* Fires before a particular screen is loaded.

View File

@ -206,7 +206,7 @@ if ( $doaction ) {
$sendback = remove_query_arg( array( 'action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback );
wp_redirect( $sendback );
exit();
exit;
} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
exit;

View File

@ -134,7 +134,7 @@ class WP_Importer {
$parsed = parse_url( $blog );
if ( ! $parsed || empty( $parsed['host'] ) ) {
fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
exit();
exit;
}
if ( empty( $parsed['path'] ) ) {
$parsed['path'] = '/';
@ -148,7 +148,7 @@ class WP_Importer {
);
if ( ! $blogs ) {
fwrite( STDERR, "Error: Could not find blog\n" );
exit();
exit;
}
$blog = array_shift( $blogs );
$blog_id = (int) $blog->blog_id;
@ -176,7 +176,7 @@ class WP_Importer {
if ( ! $user_id || ! wp_set_current_user( $user_id ) ) {
fwrite( STDERR, "Error: can not find user\n" );
exit();
exit;
}
return $user_id;
@ -327,7 +327,7 @@ function get_cli_args( $param, $required = false ) {
if ( ! isset( $out[ $param ] ) && $required ) {
// Display message and exit.
echo "\"$param\" parameter is required but was not specified\n";
exit();
exit;
}
return $return;

View File

@ -1440,7 +1440,7 @@ window.location = 'about.php?updated';
// Include admin-footer.php and exit.
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
}
/**

View File

@ -47,7 +47,7 @@ wp_default_packages_scripts( $wp_scripts );
if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
header( "$protocol 304 Not Modified" );
exit();
exit;
}
foreach ( $load as $handle ) {

View File

@ -46,7 +46,7 @@ wp_default_styles( $wp_styles );
if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
header( "$protocol 304 Not Modified" );
exit();
exit;
}
foreach ( $load as $handle ) {

View File

@ -53,7 +53,7 @@ switch ( $action ) {
if ( empty( $_GET['attachment_id'] ) ) {
wp_redirect( admin_url( 'upload.php' ) );
exit();
exit;
}
$att_id = (int) $_GET['attachment_id'];

View File

@ -353,7 +353,7 @@ switch ( $action ) {
}
wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) );
exit();
exit;
}
} else {
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
@ -388,7 +388,7 @@ switch ( $action ) {
// If the menu ID changed, redirect to the new URL.
if ( $nav_menu_selected_id != $_nav_menu_selected_id ) {
wp_redirect( admin_url( 'nav-menus.php?menu=' . intval( $_nav_menu_selected_id ) ) );
exit();
exit;
}
}
}
@ -396,7 +396,7 @@ switch ( $action ) {
case 'locations':
if ( ! $num_locations ) {
wp_redirect( admin_url( 'nav-menus.php' ) );
exit();
exit;
}
add_filter( 'screen_options_show_screen', '__return_false' );

View File

@ -38,4 +38,4 @@ do_action( 'wpmuadminedit' );
do_action( "network_admin_edit_{$action}" );
wp_redirect( network_admin_url() );
exit();
exit;

View File

@ -132,7 +132,7 @@ if ( $_POST ) {
do_action( 'update_wpmu_options' );
wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
exit();
exit;
}
require_once ABSPATH . 'wp-admin/admin-header.php';

View File

@ -160,7 +160,7 @@ if ( $action ) {
if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
wp_safe_redirect( $referer );
exit();
exit;
}
add_thickbox();

View File

@ -188,14 +188,14 @@ if ( $action ) {
}
wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
exit();
exit;
}
restore_current_blog();
if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) {
wp_safe_redirect( $referer );
exit();
exit;
}
add_screen_option( 'per_page' );

View File

@ -123,7 +123,7 @@ if ( isset( $_GET['action'] ) ) {
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
} elseif ( array_key_exists( $_GET['action'], $manage_actions ) ) {
$action = $_GET['action'];
check_admin_referer( $action . '_' . $id );
@ -210,7 +210,7 @@ if ( isset( $_GET['action'] ) ) {
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
break;
case 'spam':
@ -232,7 +232,7 @@ if ( isset( $_GET['action'] ) ) {
$redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp_safe_redirect( $redirect_to );
exit();
exit;
}
} else {
// Process query defined by WP_MS_Site_List_Table::extra_table_nav().
@ -295,7 +295,7 @@ if ( isset( $_GET['action'] ) ) {
if ( ! empty( $updated_action ) ) {
wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );
exit();
exit;
}
}

View File

@ -39,7 +39,7 @@ if ( isset( $_GET['action'] ) ) {
} else {
wp_redirect( network_admin_url( 'users.php' ) );
}
exit();
exit;
case 'allusers':
if ( ! current_user_can( 'manage_network_users' ) ) {
@ -66,7 +66,7 @@ if ( isset( $_GET['action'] ) ) {
confirm_delete_users( $_POST['allusers'] );
echo '</div>';
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
case 'spam':
$user = get_userdata( $user_id );
@ -122,7 +122,7 @@ if ( isset( $_GET['action'] ) ) {
$sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp_safe_redirect( $sendback );
exit();
exit;
}
wp_safe_redirect(
@ -142,7 +142,7 @@ if ( isset( $_GET['action'] ) ) {
}
wp_redirect( $location );
}
exit();
exit;
case 'dodelete':
check_admin_referer( 'ms-users-delete' );
@ -193,7 +193,7 @@ if ( isset( $_GET['action'] ) ) {
network_admin_url( 'users.php' )
)
);
exit();
exit;
}
}

View File

@ -11,7 +11,7 @@ require_once __DIR__ . '/admin.php';
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'plugin-editor.php' ) );
exit();
exit;
}
if ( ! current_user_can( 'edit_plugins' ) ) {

View File

@ -21,7 +21,7 @@ if ( ! current_user_can( 'install_plugins' ) ) {
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'plugin-install.php' ) );
exit();
exit;
}
$wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' );

View File

@ -113,14 +113,14 @@ switch ( $action ) {
check_admin_referer( 'add-' . $post_type );
$post_id = 'postajaxpost' === $action ? edit_post() : write_post();
redirect_post( $post_id );
exit();
exit;
case 'edit':
$editing = true;
if ( empty( $post_id ) ) {
wp_redirect( admin_url( 'post.php' ) );
exit();
exit;
}
if ( ! $post ) {
@ -147,7 +147,7 @@ switch ( $action ) {
check_admin_referer( 'lock-post_' . $post_id );
wp_set_post_lock( $post_id );
wp_redirect( get_edit_post_link( $post_id, 'url' ) );
exit();
exit;
}
$post_type = $post->post_type;
@ -233,7 +233,7 @@ switch ( $action ) {
redirect_post( $post_id ); // Send user on their way while we keep working.
exit();
exit;
case 'trash':
check_admin_referer( 'trash-post_' . $post_id );
@ -270,7 +270,7 @@ switch ( $action ) {
$sendback
)
);
exit();
exit;
case 'untrash':
check_admin_referer( 'untrash-post_' . $post_id );
@ -292,7 +292,7 @@ switch ( $action ) {
}
wp_redirect( add_query_arg( 'untrashed', 1, $sendback ) );
exit();
exit;
case 'delete':
check_admin_referer( 'delete-post_' . $post_id );
@ -321,7 +321,7 @@ switch ( $action ) {
}
wp_redirect( add_query_arg( 'deleted', 1, $sendback ) );
exit();
exit;
case 'preview':
check_admin_referer( 'update-post_' . $post_id );
@ -329,7 +329,7 @@ switch ( $action ) {
$url = post_preview();
wp_redirect( $url );
exit();
exit;
case 'toggle-custom-fields':
check_admin_referer( 'toggle-custom-fields' );
@ -341,7 +341,7 @@ switch ( $action ) {
}
wp_safe_redirect( wp_get_referer() );
exit();
exit;
default:
/**
@ -356,7 +356,7 @@ switch ( $action ) {
do_action( "post_action_{$action}", $post_id );
wp_redirect( admin_url( 'edit.php' ) );
exit();
exit;
} // End switch.
require_once ABSPATH . 'wp-admin/admin-footer.php';

View File

@ -11,7 +11,7 @@ require_once __DIR__ . '/admin.php';
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-editor.php' ) );
exit();
exit;
}
if ( ! current_user_can( 'edit_themes' ) ) {

View File

@ -18,7 +18,7 @@ if ( ! current_user_can( 'install_themes' ) ) {
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-install.php' ) );
exit();
exit;
}
$title = __( 'Add Themes' );

View File

@ -16,7 +16,7 @@ add_thickbox();
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'update-core.php' ) );
exit();
exit;
}
if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_languages' ) ) {

View File

@ -108,7 +108,7 @@ switch ( $wp_list_table->current_action() ) {
if ( empty( $_REQUEST['users'] ) ) {
wp_redirect( $redirect );
exit();
exit;
}
$editable_roles = get_editable_roles();
@ -153,7 +153,7 @@ switch ( $wp_list_table->current_action() ) {
}
wp_redirect( add_query_arg( 'update', $update, $redirect ) );
exit();
exit;
case 'dodelete':
if ( is_multisite() ) {
@ -164,7 +164,7 @@ switch ( $wp_list_table->current_action() ) {
if ( empty( $_REQUEST['users'] ) ) {
wp_redirect( $redirect );
exit();
exit;
}
$userids = array_map( 'intval', (array) $_REQUEST['users'] );
@ -211,7 +211,7 @@ switch ( $wp_list_table->current_action() ) {
$redirect
);
wp_redirect( $redirect );
exit();
exit;
case 'delete':
if ( is_multisite() ) {
@ -222,7 +222,7 @@ switch ( $wp_list_table->current_action() ) {
if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
wp_redirect( $redirect );
exit();
exit;
}
if ( ! current_user_can( 'delete_users' ) ) {
@ -393,7 +393,7 @@ switch ( $wp_list_table->current_action() ) {
if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
wp_redirect( $redirect );
exit();
exit;
}
if ( ! current_user_can( 'remove_users' ) ) {

View File

@ -752,7 +752,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
// Protect against chained redirects.
if ( ! redirect_canonical( $redirect_url, false ) ) {
wp_redirect( $redirect_url, 301 );
exit();
exit;
} else {
// Debug.
// die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) );

View File

@ -505,7 +505,7 @@ class WP {
}
if ( $exit_required ) {
exit();
exit;
}
/**

View File

@ -282,11 +282,11 @@ function wpmu_admin_do_redirect( $url = '' ) {
if ( $ref ) {
$ref = wpmu_admin_redirect_add_updated_param( $ref );
wp_redirect( $ref );
exit();
exit;
}
if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
wp_redirect( $_SERVER['HTTP_REFERER'] );
exit();
exit;
}
$url = wpmu_admin_redirect_add_updated_param( $url );
@ -299,7 +299,7 @@ function wpmu_admin_do_redirect( $url = '' ) {
$url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );
}
wp_redirect( $url );
exit();
exit;
}
/**

View File

@ -2099,12 +2099,14 @@ function maybe_redirect_404() {
* @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT.
*/
$destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT );
if ( $destination ) {
if ( '%siteurl%' === $destination ) {
$destination = network_home_url();
}
wp_redirect( $destination );
exit();
exit;
}
}
}

View File

@ -1048,10 +1048,10 @@ if ( ! function_exists( 'auth_redirect' ) ) :
if ( $secure && ! is_ssl() && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
exit;
} else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
exit;
}
}
@ -1079,10 +1079,10 @@ if ( ! function_exists( 'auth_redirect' ) ) :
if ( ! $secure && get_user_option( 'use_ssl', $user_id ) && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
exit;
} else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
exit;
}
}
@ -1097,7 +1097,7 @@ if ( ! function_exists( 'auth_redirect' ) ) :
$login_url = wp_login_url( $redirect, true );
wp_redirect( $login_url );
exit();
exit;
}
endif;

View File

@ -24,7 +24,7 @@ if ( wp_using_themes() ) {
* @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
*/
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
exit();
exit;
}
// Process feeds and trackbacks even if not using themes.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47854';
$wp_version = '5.5-alpha-47855';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -15,10 +15,10 @@ require __DIR__ . '/wp-load.php';
if ( force_ssl_admin() && ! is_ssl() ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
exit;
} else {
wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
exit;
}
}
@ -756,7 +756,7 @@ switch ( $action ) {
setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
wp_safe_redirect( wp_get_referer() );
exit();
exit;
case 'logout':
check_admin_referer( 'log-out' );
@ -792,7 +792,7 @@ switch ( $action ) {
$redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );
wp_safe_redirect( $redirect_to );
exit();
exit;
case 'lostpassword':
case 'retrievepassword':
@ -802,7 +802,7 @@ switch ( $action ) {
if ( ! is_wp_error( $errors ) ) {
$redirect_to = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
wp_safe_redirect( $redirect_to );
exit();
exit;
}
}
@ -1036,7 +1036,7 @@ switch ( $action ) {
if ( ! get_option( 'users_can_register' ) ) {
wp_redirect( site_url( 'wp-login.php?registration=disabled' ) );
exit();
exit;
}
$user_login = '';
@ -1056,7 +1056,7 @@ switch ( $action ) {
if ( ! is_wp_error( $errors ) ) {
$redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
wp_safe_redirect( $redirect_to );
exit();
exit;
}
}