Changeset 58994 for trunk/src/wp-admin/includes/upgrade.php
- Timestamp:
- 09/05/2024 02:57:46 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r58975 r58994 461 461 * TODO: Get previous_blog_id. 462 462 */ 463 if ( ! is_super_admin( $user_id ) && 1 != $user_id ) {463 if ( ! is_super_admin( $user_id ) && 1 !== $user_id ) { 464 464 $wpdb->delete( 465 465 $wpdb->usermeta, … … 640 640 * @since 2.1.0 641 641 * 642 * @global int 643 * @global int 642 * @global int $wp_current_db_version The old (current) database version. 643 * @global int $wp_db_version The new database version. 644 644 */ 645 645 function wp_upgrade() { 646 646 global $wp_current_db_version, $wp_db_version; 647 647 648 $wp_current_db_version = __get_option( 'db_version' );648 $wp_current_db_version = (int) __get_option( 'db_version' ); 649 649 650 650 // We are up to date. Nothing to do. 651 if ( $wp_db_version == $wp_current_db_version ) {651 if ( $wp_db_version === $wp_current_db_version ) { 652 652 return; 653 653 } … … 701 701 global $wp_current_db_version, $wp_db_version; 702 702 703 $wp_current_db_version = __get_option( 'db_version' );703 $wp_current_db_version = (int) __get_option( 'db_version' ); 704 704 705 705 // We are up to date. Nothing to do. 706 if ( $wp_db_version == $wp_current_db_version ) {706 if ( $wp_db_version === $wp_current_db_version ) { 707 707 return; 708 708 } … … 927 927 // Check to see if it's already been imported. 928 928 $cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category ) ); 929 if ( ! $cat && 0 != $post->post_category ) { // If there's no result.929 if ( ! $cat && 0 !== (int) $post->post_category ) { // If there's no result. 930 930 $wpdb->insert( 931 931 $wpdb->post2cat, … … 1100 1100 $options = $wpdb->get_results( "SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name" ); 1101 1101 foreach ( $options as $option ) { 1102 if ( 1 != $option->dupes) { // Could this be done in the query?1102 if ( $option->dupes > 1 ) { // Could this be done in the query? 1103 1103 $limit = $option->dupes - 1; 1104 1104 $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) ); … … 1450 1450 if ( ! empty( $links ) ) { 1451 1451 foreach ( $links as $link ) { 1452 if ( 0 == $link->link_category ) {1452 if ( 0 === (int) $link->link_category ) { 1453 1453 continue; 1454 1454 } … … 1675 1675 * but now 2 is the minimum depth to avoid confusion. 1676 1676 */ 1677 if ( get_option( 'thread_comments_depth' ) == '1') {1677 if ( 1 === (int) get_option( 'thread_comments_depth' ) ) { 1678 1678 update_option( 'thread_comments_depth', 2 ); 1679 1679 update_option( 'thread_comments', 0 ); … … 2552 2552 $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" ); 2553 2553 foreach ( $indexes as $index ) { 2554 if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 != $index->Sub_part ) {2554 if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && '140' !== $index->Sub_part ) { 2555 2555 $upgrade = true; 2556 2556 break; … … 3122 3122 3123 3123 // Is actual field type different from the field type in query? 3124 if ( $tablefield->Type != $fieldtype ) {3124 if ( $tablefield->Type !== $fieldtype ) { 3125 3125 $do_change = true; 3126 3126 if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) { … … 3162 3162 if ( preg_match( "| DEFAULT '(.*?)'|i", $cfields[ $tablefield_field_lowercased ], $matches ) ) { 3163 3163 $default_value = $matches[1]; 3164 if ( $tablefield->Default != $default_value ) {3164 if ( $tablefield->Default !== $default_value ) { 3165 3165 // Add a query to change the column's default value 3166 3166 $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'"; … … 3201 3201 'subpart' => $tableindex->Sub_part, 3202 3202 ); 3203 $index_ary[ $keyname ]['unique'] = ( 0== $tableindex->Non_unique ) ? true : false;3203 $index_ary[ $keyname ]['unique'] = ( '0' === $tableindex->Non_unique ) ? true : false; 3204 3204 $index_ary[ $keyname ]['index_type'] = $tableindex->Index_type; 3205 3205 } … … 3553 3553 // Make the new site theme active. 3554 3554 $current_template = __get_option( 'template' ); 3555 if ( WP_DEFAULT_THEME == $current_template ) {3555 if ( WP_DEFAULT_THEME === $current_template ) { 3556 3556 update_option( 'template', $template ); 3557 3557 update_option( 'stylesheet', $template );
Note: See TracChangeset
for help on using the changeset viewer.