diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index 76af47f8af..113c4e8b28 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -20,7 +20,7 @@ function check_upload_size( $file ) {
return $file;
}
- if ( '0' != $file['error'] ) { // There's already an error.
+ if ( $file['error'] > 0 ) { // There's already an error.
return $file;
}
@@ -45,7 +45,7 @@ function check_upload_size( $file ) {
$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
}
- if ( '0' != $file['error'] && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {
+ if ( $file['error'] > 0 && ! isset( $_POST['html-upload'] ) && ! wp_doing_ajax() ) {
wp_die( $file['error'] . ' ' . __( 'Back' ) . '' );
}
@@ -66,8 +66,10 @@ function check_upload_size( $file ) {
function wpmu_delete_blog( $blog_id, $drop = false ) {
global $wpdb;
+ $blog_id = (int) $blog_id;
+
$switch = false;
- if ( get_current_blog_id() != $blog_id ) {
+ if ( get_current_blog_id() !== $blog_id ) {
$switch = true;
switch_to_blog( $blog_id );
}
@@ -82,7 +84,10 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
}
// Don't destroy the initial, main, or root blog.
- if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_network->path && $blog->domain == $current_network->domain ) ) ) {
+ if ( $drop
+ && ( 1 === $blog_id || is_main_site( $blog_id )
+ || ( $blog->path === $current_network->path && $blog->domain === $current_network->domain ) )
+ ) {
$drop = false;
}
@@ -702,7 +707,7 @@ function site_admin_notice() {
return;
}
- if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) {
+ if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) {
echo "
" . sprintf(
/* translators: %s: URL to Upgrade Network screen. */
__( 'Thank you for Updating! Please visit the
Upgrade Network page to update all your sites.' ),
@@ -742,13 +747,16 @@ function avoid_blog_page_permalink_collision( $data, $postarr ) {
$post_name = $data['post_name'];
$c = 0;
+
while ( $c < 10 && get_id_from_blogname( $post_name ) ) {
$post_name .= mt_rand( 1, 10 );
- $c ++;
+ $c++;
}
- if ( $post_name != $data['post_name'] ) {
+
+ if ( $post_name !== $data['post_name'] ) {
$data['post_name'] = $post_name;
}
+
return $data;
}
@@ -769,14 +777,14 @@ function choose_primary_blog() {
1 ) {
$found = false;
?>
|