Coding Standards: Use strict comparison and Yoda conditions in the root directory files.
Props pikamander2. Fixes #48965. Built from https://develop.svn.wordpress.org/trunk@47054 git-svn-id: http://core.svn.wordpress.org/trunk@46854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -37,7 +37,7 @@ if ( isset( $_GET['key'] ) && isset( $_POST['key'] ) && $_GET['key'] !== $_POST[
|
||||
if ( $key ) {
|
||||
$redirect_url = remove_query_arg( 'key' );
|
||||
|
||||
if ( $redirect_url !== remove_query_arg( false ) ) {
|
||||
if ( remove_query_arg( false ) !== $redirect_url ) {
|
||||
setcookie( $activate_cookie, $key, 0, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
|
||||
wp_safe_redirect( $redirect_url );
|
||||
exit;
|
||||
@@ -46,13 +46,13 @@ if ( $key ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $result === null && isset( $_COOKIE[ $activate_cookie ] ) ) {
|
||||
if ( null === $result && isset( $_COOKIE[ $activate_cookie ] ) ) {
|
||||
$key = $_COOKIE[ $activate_cookie ];
|
||||
$result = wpmu_activate_signup( $key );
|
||||
setcookie( $activate_cookie, ' ', time() - YEAR_IN_SECONDS, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
|
||||
}
|
||||
|
||||
if ( $result === null || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
|
||||
if ( null === $result || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
|
||||
status_header( 404 );
|
||||
} elseif ( is_wp_error( $result ) ) {
|
||||
$error_code = $result->get_error_code();
|
||||
@@ -142,7 +142,7 @@ get_header( 'wp-activate' );
|
||||
<h2><?php _e( 'Your account is now active!' ); ?></h2>
|
||||
<?php
|
||||
echo '<p class="lead-in">';
|
||||
if ( $signup->domain . $signup->path == '' ) {
|
||||
if ( '' === $signup->domain . $signup->path ) {
|
||||
printf(
|
||||
/* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */
|
||||
__( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
|
||||
@@ -162,7 +162,7 @@ get_header( 'wp-activate' );
|
||||
);
|
||||
}
|
||||
echo '</p>';
|
||||
} elseif ( $result === null || is_wp_error( $result ) ) {
|
||||
} elseif ( null === $result || is_wp_error( $result ) ) {
|
||||
?>
|
||||
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
|
||||
<?php if ( is_wp_error( $result ) ) : ?>
|
||||
@@ -181,7 +181,7 @@ get_header( 'wp-activate' );
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( $url && $url != network_home_url( '', 'http' ) ) :
|
||||
if ( $url && network_home_url( '', 'http' ) !== $url ) :
|
||||
switch_to_blog( (int) $result['blog_id'] );
|
||||
$login_url = wp_login_url();
|
||||
restore_current_blog();
|
||||
|
||||
Reference in New Issue
Block a user