Changeset 47219 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 02/09/2020 04:52:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r47177 r47219 72 72 } 73 73 74 if ( ( ! is_object( $primary ) ) || ( $primary->archived == 1 || $primary->spam == 1 || $primary->deleted == 1) ) {74 if ( ( ! is_object( $primary ) ) || ( 1 == $primary->archived || 1 == $primary->spam || 1 == $primary->deleted ) ) { 75 75 $blogs = get_blogs_of_user( $user_id, true ); // If a user's primary blog is shut down, check their other blogs. 76 76 $ret = false; 77 77 if ( is_array( $blogs ) && count( $blogs ) > 0 ) { 78 78 foreach ( (array) $blogs as $blog_id => $blog ) { 79 if ( $blog->site_id != get_current_network_id()) {79 if ( get_current_network_id() != $blog->site_id ) { 80 80 continue; 81 81 } 82 82 $details = get_site( $blog_id ); 83 if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0) {83 if ( is_object( $details ) && 0 == $details->archived && 0 == $details->spam && 0 == $details->deleted ) { 84 84 $ret = $details; 85 85 if ( get_user_meta( $user_id, 'primary_blog', true ) != $blog_id ) { … … 352 352 $id = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' ); 353 353 354 if ( $id == -1) { // Blog does not exist.354 if ( -1 == $id ) { // Blog does not exist. 355 355 return 0; 356 356 } elseif ( $id ) { … … 420 420 421 421 $dotted_domain = ".$banned_domain"; 422 if ( $dotted_domain === substr( $normalized_email, -strlen( $dotted_domain ) )) {422 if ( substr( $normalized_email, -strlen( $dotted_domain ) ) === $dotted_domain ) { 423 423 $is_email_address_unsafe = true; 424 424 break; … … 540 540 // Has someone already signed up for this username? 541 541 $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name ) ); 542 if ( $signup != null) {542 if ( null != $signup ) { 543 543 $registered_at = mysql2date( 'U', $signup->registered ); 544 544 $now = time(); … … 553 553 554 554 $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email ) ); 555 if ( $signup != null) {555 if ( null != $signup ) { 556 556 $diff = time() - mysql2date( 'U', $signup->registered ); 557 557 // If registered more than two days ago, cancel registration and let this signup go through. … … 633 633 $errors = new WP_Error(); 634 634 $illegal_names = get_site_option( 'illegal_names' ); 635 if ( $illegal_names == false) {635 if ( false == $illegal_names ) { 636 636 $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); 637 637 add_site_option( 'illegal_names', $illegal_names ); … … 946 946 $activate_url = esc_url( $activate_url ); 947 947 $admin_email = get_site_option( 'admin_email' ); 948 if ( $admin_email == '') {948 if ( '' == $admin_email ) { 949 949 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 950 950 } … … 1071 1071 // Send email with activation link. 1072 1072 $admin_email = get_site_option( 'admin_email' ); 1073 if ( $admin_email == '') {1073 if ( '' == $admin_email ) { 1074 1074 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 1075 1075 } … … 1590 1590 1591 1591 $welcome_email = get_site_option( 'welcome_email' ); 1592 if ( $welcome_email == false) {1592 if ( false == $welcome_email ) { 1593 1593 /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */ 1594 1594 $welcome_email = __( … … 1635 1635 $admin_email = get_site_option( 'admin_email' ); 1636 1636 1637 if ( $admin_email == '') {1637 if ( '' == $admin_email ) { 1638 1638 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 1639 1639 } … … 1727 1727 $admin_email = get_site_option( 'admin_email' ); 1728 1728 1729 if ( $admin_email == '') {1729 if ( '' == $admin_email ) { 1730 1730 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 1731 1731 } … … 1850 1850 foreach ( $site_exts as $ext ) { 1851 1851 foreach ( $mimes as $ext_pattern => $mime ) { 1852 if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false) {1852 if ( '' != $ext && false !== strpos( $ext_pattern, $ext ) ) { 1853 1853 $site_mimes[ $ext_pattern ] = $mime; 1854 1854 } … … 1937 1937 // Prevent a race condition. 1938 1938 $recurse_start = false; 1939 if ( $global_terms_recurse === null) {1939 if ( null === $global_terms_recurse ) { 1940 1940 $recurse_start = true; 1941 1941 $global_terms_recurse = 1; … … 1948 1948 1949 1949 $global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s", $c->slug ) ); 1950 if ( $global_id == null) {1950 if ( null == $global_id ) { 1951 1951 $used_global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d", $c->term_id ) ); 1952 1952 if ( null == $used_global_id ) { … … 2094 2094 $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ); 2095 2095 if ( $destination ) { 2096 if ( $destination == '%siteurl%') {2096 if ( '%siteurl%' === $destination ) { 2097 2097 $destination = network_home_url(); 2098 2098 } … … 2120 2120 $key = array_pop( $parts ); 2121 2121 2122 if ( $key == '') {2122 if ( '' == $key ) { 2123 2123 $key = array_pop( $parts ); 2124 2124 } … … 2262 2262 function users_can_register_signup_filter() { 2263 2263 $registration = get_site_option( 'registration' ); 2264 return ( $registration == 'all' || $registration == 'user');2264 return ( 'all' === $registration || 'user' === $registration ); 2265 2265 } 2266 2266 … … 2660 2660 */ 2661 2661 function update_network_option_new_admin_email( $old_value, $value ) { 2662 if ( $value == get_site_option( 'admin_email' )|| ! is_email( $value ) ) {2662 if ( get_site_option( 'admin_email' ) === $value || ! is_email( $value ) ) { 2663 2663 return; 2664 2664 }
Note: See TracChangeset
for help on using the changeset viewer.